]> git.neil.brown.name Git - LaFS.git/commitdiff
lafs_incorporate - don't clear a block with children.
authorNeilBrown <neilb@suse.de>
Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)
If an index block has children, then erasing it is pointless
and confusing.  So don't.

modify.c

index 7d0db50869eafc72d76602339bd9d7cf5c5b0b42..820717962845edfcd9205476ccfb27165650ba40 100644 (file)
--- a/modify.c
+++ b/modify.c
@@ -1738,7 +1738,8 @@ void lafs_incorporate(struct fs *fs, struct indexblock *ib)
         * B_Valid so that it doesn't get written out,
         * but rather gets allocated as '0'.
         */
-       if (test_bit(B_Valid, &ib->b.flags)) {
+       if (test_bit(B_Valid, &ib->b.flags) &&
+           list_empty(&ib->children)) {
                if (ib->depth == 1 &&
                    lafs_leaf_next(ib, ib->b.fileaddr) == 0xFFFFFFFF)
                        clear_bit(B_Valid, &ib->b.flags);