From: NeilBrown Date: Tue, 6 Jul 2010 10:01:47 +0000 (+1000) Subject: A not Valid directory orphan block is OK. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=e18de2dbbfda2ba9a513dcefb73ab400622257f8;p=LaFS.git A not Valid directory orphan block is OK. If an orphan block in a directory turns out to be not B_Valid that is OK. It could be that it got handled an extra time or something. Signed-off-by: NeilBrown --- diff --git a/dir.c b/dir.c index 1ab2ec9..db7593d 100644 --- a/dir.c +++ b/dir.c @@ -1263,12 +1263,20 @@ void lafs_dir_handle_orphan(struct datablock *b) struct dir_ent de; int err; - /* FIXME if there was an IOerror, this should not be a BUG */ - LAFS_BUG(!test_bit(B_Valid, &b->b.flags), &b->b); dprintk("HANDLE ORPHAN h=%x %s\n", (unsigned)hash, strblk(&b->b)); lafs_checkpoint_lock(fs); + if (!test_bit(B_Valid, &b->b.flags)) { + /* probably have already erased this block, + * but the orphan_release failed due to + * space being tight. + * just try again + */ + lafs_orphan_release(fs, b); + goto abort; + } + /* First test: Does a chain of deleted entries extend beyond * the end of this block. i.e. is the last entry deleted. * If so, look at the next block and see if the chain is still