Whamcloud - gitweb
e2fsck: fix off-by-one check when validating depth of an htree
authorTheodore Ts'o <tytso@mit.edu>
Fri, 10 Apr 2020 04:30:52 +0000 (00:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 14 Apr 2020 01:58:21 +0000 (21:58 -0400)
Fixes: 3f0cf6475399 ("e2fsprogs: add support for 3-level htree")

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index c9e8bf8..38afda4 100644 (file)
@@ -2685,7 +2685,7 @@ static int handle_htree(e2fsck_t ctx, struct problem_context *pctx,
                return 1;
 
        pctx->num = root->indirect_levels;
-       if ((root->indirect_levels > ext2_dir_htree_level(fs)) &&
+       if ((root->indirect_levels >= ext2_dir_htree_level(fs)) &&
            fix_problem(ctx, PR_1_HTREE_DEPTH, pctx))
                return 1;