Skip to content

Commit df41460

Browse files
joshtripletttytso
authored andcommitted
ext4: fix incorrect group count in ext4_fill_super error message
ext4_fill_super doublechecks the number of groups before mounting; if that check fails, the resulting error message prints the group count from the ext4_sb_info sbi, which hasn't been set yet. Print the freshly computed group count instead (which at that point has just been computed in "blocks_count"). Signed-off-by: Josh Triplett <[email protected]> Fixes: 4ec1102 ("ext4: Add sanity checks for the superblock before mounting the filesystem") Link: https://lore.kernel.org/r/8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o <[email protected]>
1 parent b9c538d commit df41460

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/ext4/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4305,9 +4305,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
43054305
EXT4_BLOCKS_PER_GROUP(sb) - 1);
43064306
do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb));
43074307
if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
4308-
ext4_msg(sb, KERN_WARNING, "groups count too large: %u "
4308+
ext4_msg(sb, KERN_WARNING, "groups count too large: %llu "
43094309
"(block count %llu, first data block %u, "
4310-
"blocks per group %lu)", sbi->s_groups_count,
4310+
"blocks per group %lu)", blocks_count,
43114311
ext4_blocks_count(es),
43124312
le32_to_cpu(es->s_first_data_block),
43134313
EXT4_BLOCKS_PER_GROUP(sb));

0 commit comments

Comments
 (0)