]> git.neil.brown.name Git - LaFS.git/commitdiff
Allow index block to be Realloc during truncate.
authorNeilBrown <neilb@suse.de>
Fri, 2 Jul 2010 23:41:08 +0000 (09:41 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 3 Jul 2010 00:16:09 +0000 (10:16 +1000)
And data blocks in realloc will have been destroyed in
erase_dblock, but there could legitimately be Realloc index blocks
still, so allow them to be handled.

Signed-off-by: NeilBrown <neilb@suse.de>
inode.c

diff --git a/inode.c b/inode.c
index 6a491c174f4493063c014ea9f30f2665286a70d8..17acaf76ae195eea188593e5ba5c4b65ee9b398c 100644 (file)
--- a/inode.c
+++ b/inode.c
@@ -832,7 +832,11 @@ restart:
        LAFSI(ino)->trunc_next = next_trunc;
 
        while (ib->uninc_table.pending_cnt || ib->uninc) {
-               LAFS_BUG(!test_bit(B_Dirty, &ib->b.flags), &ib->b);
+               /* There should be no Realloc data blocks here
+                * but index blocks might be realloc still.
+                */
+               LAFS_BUG(!test_bit(B_Dirty, &ib->b.flags) &&
+                        !test_bit(B_Realloc, &ib->b.flags), &ib->b);
                lafs_incorporate(fs, ib);
        }
        if (test_bit(B_InoIdx, &ib->b.flags) ||