From: NeilBrown Date: Fri, 2 Jul 2010 23:41:08 +0000 (+1000) Subject: Allow index block to be Realloc during truncate. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=1597c0a6a252dec9d7de8ea9d5c6bfb76d2b5175;p=LaFS.git Allow index block to be Realloc during truncate. 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 --- diff --git a/inode.c b/inode.c index 6a491c1..17acaf7 100644 --- 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) ||