]> git.neil.brown.name Git - LaFS.git/commitdiff
fix a BUG assertion in lafs_dirty_iblock.
authorNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 23:44:23 +0000 (10:44 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 4 Mar 2011 23:44:23 +0000 (10:44 +1100)
The InoIdx block for an inode with depth==0 is not Valid,
as it contains no index information.
However it still can be appropriate to mark it dirty when a data block
is allocated, to ensure incorporation happens correctly.

So it is not a bug to dirty a non-Valid iblock - at least if the depth
is 0.

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

diff --git a/block.c b/block.c
index 85758cf55e97199a5c369aa9266d2ffc8db8e91f..622ebcd022656bd44985f196e0edba32faf8ca59 100644 (file)
--- a/block.c
+++ b/block.c
@@ -655,7 +655,7 @@ lafs_dirty_iblock(struct indexblock *b, int want_realloc)
         */
 
        LAFS_BUG(!test_bit(B_Pinned, &b->b.flags), &b->b);
-       LAFS_BUG(!test_bit(B_Valid, &b->b.flags), &b->b);
+       LAFS_BUG(!test_bit(B_Valid, &b->b.flags) && b->depth > 0, &b->b);
 
        if (want_realloc) {
                /* Try to make for Realloc instead.  If we cannot get the