]> git.neil.brown.name Git - LaFS.git/commitdiff
lafs_incorporate InoIdx: avoid depth change when children present.
authorNeilBrown <neilb@suse.de>
Thu, 10 Jun 2010 06:32:39 +0000 (16:32 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 13 Jun 2010 07:20:00 +0000 (17:20 +1000)
If an InoIdx block appear empty but still has children we don't
want to change the depth as that can be confusing.

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

index ac67430c3a1d7406376d41228c7cba9f2ecb5441..1a519e887148bf2007d2f696c2836c486d7fa559 100644 (file)
--- a/modify.c
+++ b/modify.c
@@ -1922,6 +1922,9 @@ void lafs_incorporate(struct fs *fs, struct indexblock *ib)
         * first block in the parent, we need to recurse up and
         * resolve the parent in the same way.
         */
+       if (!list_empty(&ib->children))
+               /* If there are children, we cannot treat this block as empty. */
+               return;
        if (test_bit(B_InoIdx, &ib->b.flags)) {
                /* Empty InoIdx blocks are allowed.  However depth must
                 * be zero.  This is where we suddenly collapse a now-empty
@@ -1937,9 +1940,6 @@ void lafs_incorporate(struct fs *fs, struct indexblock *ib)
                 */
                return;
        }
-       if (!list_empty(&ib->children))
-               /* If there are children, we cannot treat this block as empty. */
-               return;
        if (ib->depth > 1 && ! lafs_index_empty(ib))
                return;
        if (ib->depth == 1 && lafs_leaf_next(ib, 0) != 0xFFFFFFFF)