]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: print the current and expected block group checksums
authorTheodore Ts'o <tytso@mit.edu>
Thu, 15 Mar 2012 23:29:19 +0000 (19:29 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 15 Mar 2012 23:29:19 +0000 (19:29 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/message.c
e2fsck/problem.c
e2fsck/problem.h
e2fsck/super.c
tests/f_illitable_flexbg/expect.1
tests/f_unused_itable/expect.1

index 1a91044b01fb5cc8bf351b8e53b32153f9b58044..627482472dc9d8a050a7aec730be79fd80c48955 100644 (file)
@@ -500,13 +500,19 @@ static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
        case 'T':
                print_time(e2fsck_ctx ? e2fsck_ctx->now : time(0));
                break;
+       case 'x':
+               printf("0x%0*x", width, ctx->csum1);
+               break;
        case 'X':
 #ifdef EXT2_NO_64_TYPE
-               printf("0x%*x", width, ctx->num);
+               printf("0x%0*x", width, ctx->num);
 #else
-               printf("0x%*llx", width, (long long)ctx->num);
+               printf("0x%0*llx", width, (long long)ctx->num);
 #endif
                break;
+       case 'y':
+               printf("0x%0*x", width, ctx->csum2);
+               break;
        default:
        no_context:
                printf("%%%c", ch);
index c66c6be85d2ff00c2f0c4c4b2dfea3998d781035..53e8e11ae827da80e67e930bb2e0ba71b51e1b69 100644 (file)
@@ -354,7 +354,7 @@ static struct e2fsck_problem problem_table[] = {
 
        /* group descriptor N checksum is invalid. */
        { PR_0_GDT_CSUM,
-         N_("@g descriptor %g checksum is invalid.  "),
+         N_("@g descriptor %g checksum is %04x, should be %04y.  "),
             PROMPT_FIX, PR_LATCH_BG_CHECKSUM },
 
        /* group descriptor N marked uninitialized without feature set. */
index f2bd414663d948b5cd915cfb9bfc4fc97277256a..5c1579daf2e6c6da388e4b4e4b5ea9a9b2adb6b7 100644 (file)
@@ -19,6 +19,7 @@ struct problem_context {
        blk64_t blk, blk2;
        e2_blkcnt_t     blkcount;
        int             group;
+       __u32           csum1, csum2;
        __u64   num;
        const char *str;
 };
index 3397d77ffcb491f10065575b08c5808582d4753b..6c18d0efe91534c81b30bdd9f2571a764011195e 100644 (file)
@@ -635,6 +635,8 @@ void check_super_block(e2fsck_t ctx)
 
                should_be = 0;
                if (!ext2fs_group_desc_csum_verify(fs, i)) {
+                       pctx.csum1 = ext2fs_bg_checksum(fs, i);
+                       pctx.csum2 = ext2fs_group_desc_csum(fs, i);
                        if (fix_problem(ctx, PR_0_GDT_CSUM, &pctx)) {
                                ext2fs_bg_flags_clear(fs, i, EXT2_BG_BLOCK_UNINIT);
                                ext2fs_bg_flags_clear(fs, i, EXT2_BG_INODE_UNINIT);
index af30bd4efa41b69c06b3465b0bbf33fe17124271..2d54728578141f4f47e87c95a6718afacc7cda4f 100644 (file)
@@ -8,7 +8,7 @@ Relocating group 1's inode table to 142...
 Restarting e2fsck from the beginning...
 One or more block group descriptor checksums are invalid.  Fix? yes
 
-Group descriptor 1 checksum is invalid.  FIXED.
+Group descriptor 1 checksum is 0x1cee, should be 0xf809.  FIXED.
 Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
 Pass 3: Checking directory connectivity
index 08a97001e02a54d9bb0c2810794b2fa391fed287..a4da987e42e5adb94cf0ae5d956716c9334205ab 100644 (file)
@@ -9,8 +9,8 @@ Fix? yes
 Restarting e2fsck from the beginning...
 One or more block group descriptor checksums are invalid.  Fix? yes
 
-Group descriptor 0 checksum is invalid.  FIXED.
-Group descriptor 1 checksum is invalid.  FIXED.
+Group descriptor 0 checksum is 0x289d, should be 0x788a.  FIXED.
+Group descriptor 1 checksum is 0xfaab, should be 0x3a9a.  FIXED.
 Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
 Pass 3: Checking directory connectivity