Skip to contentSkip to conversation

Display bad depth in error message

PATCH New Kalpak Shah 1 participant 1 message May 21, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Display bad depth in error message

Hi,

It would be good to actually print the bad htree depth as part of the error message.

e2fsck/pass2.c +1 -0
Index: e2fsprogs-1.40.7/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++;
e2fsck/problem.c +1 -1
Index: e2fsprogs-1.40.7/e2fsck/problem.c
===================================================================
@@ -1288,7 +1288,7 @@ static struct e2fsck_problem problem_tab
 
        /* 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 */

Thanks,
Kalpak