diff options
author | Theodore Ts'o <tytso@mit.edu> | 2012-03-15 12:13:25 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-03-15 12:13:25 -0400 |
commit | 87141781aabb4dc01359428d2feecdc7f43eeac0 (patch) | |
tree | 51c39de3f34e5c64518a87731d99087ba2e8969f /misc/dumpe2fs.c | |
parent | def8da382927803a88d6003d5baa159f668a153b (diff) | |
download | e2fsprogs-87141781aabb4dc01359428d2feecdc7f43eeac0.tar.gz |
dumpe2fs: print the expected block group checksum if it is incorrectnext
This helps to diagnose problems caused by incorrect block group
checksums.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/dumpe2fs.c')
-rw-r--r-- | misc/dumpe2fs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c index 5b114e96..7b7e3fe2 100644 --- a/misc/dumpe2fs.c +++ b/misc/dumpe2fs.c @@ -190,10 +190,16 @@ static void list_desc (ext2_filsys fs) print_range(first_block, last_block); fputs(")", stdout); print_bg_opts(fs, i); - if (fs->super->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) - printf(_(" Checksum 0x%04x, unused inodes %u\n"), - ext2fs_bg_checksum(fs, i), + if (fs->super->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_GDT_CSUM) { + unsigned csum = ext2fs_bg_checksum(fs, i); + unsigned exp_csum = ext2fs_group_desc_csum(fs, i); + + printf(_(" Checksum 0x%04x"), csum); + if (csum != exp_csum) + printf(_(" (EXPECTED 0x%04x)"), exp_csum); + printf(_(", unused inodes %u\n"), ext2fs_bg_itable_unused(fs, i)); + } has_super = ((i==0) || super_blk); if (has_super) { printf (_(" %s superblock at "), |