From a30f6c9fc53fd7af5f94a92929e581cdd291377c Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 10 Jun 2010 16:32:39 +1000 Subject: [PATCH] lafs_incorporate InoIdx: avoid depth change when children present. 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 --- modify.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modify.c b/modify.c index ac67430..1a519e8 100644 --- 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) -- 2.39.5