LAFS_BUG(!test_bit(B_Valid, &b->flags), b);
LAFS_BUG(!fs->rolled, b);
LAFS_BUG(lai->flags & File_nonlogged &&
- !test_bit(B_Index, &b->flags), b);
+ !test_bit(B_Index, &b->flags), b);
+
+ /* We cannot change the physaddr of an uniblock in a
+ * different phase to the parent, else the parent will
+ * get the wrong address.
+ */
+ LAFS_BUG(test_bit(B_Index, &b->flags) &&
+ test_bit(B_Uninc, &b->flags) &&
+ !!test_bit(B_Phase1, &b->flags) !=
+ !!test_bit(B_Phase1, &b->parent->b.flags), b);
size = i_size_read(b->inode);
if (!test_bit(B_Index, &b->flags) && /* it is a datablock */
if (test_and_set_bit(B_Writeback, &b->flags))
LAFS_BUG(1, b);
lafs_iounlock_block(b);
+
+ if (test_bit(B_EmptyIndex, &b->flags)) {
+ lafs_allocated_block(fs, b, 0);
+ lafs_writeback_done(b);
+ mutex_unlock(&wc->lock);
+ return wc->cluster_seq; /* FIXME is this really needed - or right */
+ }
/* insert into list ensuring there is enough space
* in cluster head
*/