]> git.neil.brown.name Git - LaFS.git/commitdiff
A not Valid directory orphan block is OK.
authorNeilBrown <neilb@suse.de>
Tue, 6 Jul 2010 10:01:47 +0000 (20:01 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 6 Jul 2010 10:01:47 +0000 (20:01 +1000)
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 <neilb@suse.de>
dir.c

diff --git a/dir.c b/dir.c
index 1ab2ec910a8a29ab5bc88140b9aea6772725cc5f..db7593deebc1f6cf0db7058bd4fd256b30fc2707 100644 (file)
--- 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