From e5e12db959d3c18f6cf4ac938a14f68be0a89acc Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 23 Aug 2008 21:45:11 -0600 Subject: [PATCH] fix e2fsck error message for bad htree depth Fix error message to print the depth of a corrupt htree directory. Signed-off-by: Andreas Dilger Signed-off-by: Kalpak Shah Signed-off-by: Theodore Ts'o --- e2fsck/pass2.c | 1 + e2fsck/problem.c | 2 +- tests/f_h_badnode/expect.1 | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 7aa693b..f4fa93e 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -213,6 +213,7 @@ void e2fsck_pass2(e2fsck_t ctx) if (dx_db->type == DX_DIRBLOCK_LEAF) { depth = htree_depth(dx_dir, dx_db); if (depth != dx_dir->depth) { + pctx.num = dx_dir->depth; code = PR_2_HTREE_BAD_DEPTH; fix_problem(ctx, code, &pctx); bad_dir++; diff --git a/e2fsck/problem.c b/e2fsck/problem.c index f0d5b18..9d4c4e8 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -1240,7 +1240,7 @@ static struct e2fsck_problem problem_table[] = { /* Node in HTREE directory has invalid depth */ { PR_2_HTREE_BAD_DEPTH, - N_("@p @h %d: node (%B) has @n depth\n"), + N_("@p @h %d: node (%B) has @n depth (%N)\n"), PROMPT_NONE, 0 }, /* Duplicate directory entry found */ diff --git a/tests/f_h_badnode/expect.1 b/tests/f_h_badnode/expect.1 index 80c82d3..44d4a7c 100644 --- a/tests/f_h_badnode/expect.1 +++ b/tests/f_h_badnode/expect.1 @@ -3,7 +3,7 @@ Pass 2: Checking directory structure Problem in HTREE directory inode 12929: node (531) has bad max hash Problem in HTREE directory inode 12929: node (993) referenced twice Problem in HTREE directory inode 12929: node (1061) has bad min hash -Problem in HTREE directory inode 12929: node (1062) has invalid depth +Problem in HTREE directory inode 12929: node (1062) has invalid depth (2) Problem in HTREE directory inode 12929: node (1062) has bad max hash Problem in HTREE directory inode 12929: node (1062) not referenced Invalid HTREE directory inode 12929 (/test2). Clear HTree index? yes -- 1.8.3.1