linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Josh Triplett <josh@joshtriplett.org>
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andreas Dilger <adilger.kernel@dilger.ca>
Subject: Re: [PATCH] ext4: Fix incorrect group count in ext4_fill_super error message
Date: Sat, 28 Mar 2020 22:47:09 -0400	[thread overview]
Message-ID: <20200329024709.GK53396@mit.edu> (raw)
In-Reply-To: <8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org>

On Sat, Mar 28, 2020 at 02:54:01PM -0700, Josh Triplett wrote:
> 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 <josh@joshtriplett.org>
> Fixes: 4ec1102813798 ("ext4: Add sanity checks for the superblock before mounting the filesystem")

Applied, with a fix to the format string:

>  fs/ext4/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 0c7c4adb664e..7f5f37653a03 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4288,7 +4288,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  	if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
>  		ext4_msg(sb, KERN_WARNING, "groups count too large: %u "

s/%u/%llu/

>  		       "(block count %llu, first data block %u, "
> -		       "blocks per group %lu)", sbi->s_groups_count,
> +		       "blocks per group %lu)", blocks_count,
>  		       ext4_blocks_count(es),
>  		       le32_to_cpu(es->s_first_data_block),
>  		       EXT4_BLOCKS_PER_GROUP(sb));
> -- 
> 2.26.0

						- Ted

  parent reply	other threads:[~2020-03-29  2:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 21:54 [PATCH] ext4: Fix incorrect group count in ext4_fill_super error message Josh Triplett
2020-03-28 22:44 ` kbuild test robot
2020-03-28 23:07 ` Andreas Dilger
2020-03-28 23:55   ` Josh Triplett
2020-03-29  2:47 ` Theodore Y. Ts'o [this message]
2020-03-29  4:36   ` Andreas Dilger
2020-03-29 16:44     ` Theodore Y. Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200329024709.GK53396@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger.kernel@dilger.ca \
    --cc=josh@joshtriplett.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).