Skip to content

Commit

Permalink
dumpe2fs: output cleanup
Browse files Browse the repository at this point in the history
Don't display unused inodes twice, and make it clear that we're
printing a descriptor checksum.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: TR Reardon <thomas_reardon@hotmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
djwong authored and tytso committed Dec 14, 2014
1 parent 6aa8cff commit 492084f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions misc/dumpe2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,18 @@ static void list_desc(ext2_filsys fs, int grp_only)
continue;
}

printf (_("Group %lu: (Blocks "), i);
printf(_("Group %lu: (Blocks "), i);
print_range(first_block, last_block);
fputs(")", stdout);
print_bg_opts(fs, i);
if (ext2fs_has_group_desc_csum(fs)) {
unsigned csum = ext2fs_bg_checksum(fs, i);
unsigned exp_csum = ext2fs_group_desc_csum(fs, i);

printf(_(" Checksum 0x%04x"), csum);
printf(_(" csum 0x%04x"), csum);
if (csum != exp_csum)
printf(_(" (EXPECTED 0x%04x)"), exp_csum);
printf(_(", unused inodes %u\n"),
ext2fs_bg_itable_unused(fs, i));
}
print_bg_opts(fs, i);
has_super = ((i==0) || super_blk);
if (has_super) {
printf (_(" %s superblock at "),
Expand Down
2 changes: 2 additions & 0 deletions tests/filter.sed
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ s/\\015//g
/Reserved blocks gid:/s/ (group .*)//
/whichever comes first/d
/^ Checksum /d
s/, csum 0x\([0-9a-f]*\)//g
s/ csum 0x\([0-9a-f]*\)//g

0 comments on commit 492084f

Please sign in to comment.