OSDN Git Service

fix e2fsck error message for bad htree depth
authorAndreas Dilger <adilger@sun.com>
Sun, 24 Aug 2008 03:45:11 +0000 (21:45 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 25 Aug 2008 01:57:31 +0000 (21:57 -0400)
Fix error message to print the depth of a corrupt htree directory.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass2.c
e2fsck/problem.c
tests/f_h_badnode/expect.1

index 7aa693b..f4fa93e 100644 (file)
@@ -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++;
index f0d5b18..9d4c4e8 100644 (file)
@@ -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 */
index 80c82d3..44d4a7c 100644 (file)
@@ -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