linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yongpeng Yang <yangyongpeng.storage@gmail.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Yongpeng Yang <yangyongpeng.storage@gmail.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>,
	Sungjong Seo <sj1557.seo@samsung.com>, Jan Kara <jack@suse.cz>,
	Carlos Maiolino <cem@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sasha Levin <sashal@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-block@vger.kernel.org, stable@vger.kernel.org,
	Matthew Wilcox <willy@infradead.org>,
	"Darrick J . Wong" <djwong@kernel.org>,
	Yongpeng Yang <yangyongpeng@xiaomi.com>
Subject: Re: [PATCH v2] fix missing sb_min_blocksize() return value checks in some filesystems
Date: Mon, 3 Nov 2025 21:40:18 +0800	[thread overview]
Message-ID: <07ab7f80-889e-4a28-adf9-12fc038bdc27@gmail.com> (raw)
In-Reply-To: <87cy60idr2.fsf@mail.parknet.co.jp>

On 11/3/2025 12:46 AM, OGAWA Hirofumi wrote:
> Yongpeng Yang <yangyongpeng.storage@gmail.com> writes:
> 
>> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
>> index 9648ed097816..d22eec4f17b2 100644
>> --- a/fs/fat/inode.c
>> +++ b/fs/fat/inode.c
>> @@ -1535,7 +1535,7 @@ int fat_fill_super(struct super_block *sb, struct fs_context *fc,
>>   		   void (*setup)(struct super_block *))
>>   {
>>   	struct fat_mount_options *opts = fc->fs_private;
>> -	int silent = fc->sb_flags & SB_SILENT;
>> +	int silent = fc->sb_flags & SB_SILENT, blocksize;
>>   	struct inode *root_inode = NULL, *fat_inode = NULL;
>>   	struct inode *fsinfo_inode = NULL;
>>   	struct buffer_head *bh;
>> @@ -1595,8 +1595,13 @@ int fat_fill_super(struct super_block *sb, struct fs_context *fc,
>>   
>>   	setup(sb); /* flavour-specific stuff that needs options */
>>   
>> +	error = -EINVAL;
>> +	blocksize = sb_min_blocksize(sb, 512);
>> +	if (!blocksize) {
> 
> 	if (!sb_min_blocksize(sb, 512)) {
> 
> Looks like this one is enough?
> 

Thanks for the review. Yes, blocksize doesn't serve any other purpose. 
I'll remove it in v2.

Yongpeng,

>> +		fat_msg(sb, KERN_ERR, "unable to set blocksize");
>> +		goto out_fail;
>> +	}


  reply	other threads:[~2025-11-03 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-02 16:38 [PATCH v2] fix missing sb_min_blocksize() return value checks in some filesystems Yongpeng Yang
2025-11-02 16:46 ` OGAWA Hirofumi
2025-11-03 13:40   ` Yongpeng Yang [this message]
2025-11-03 11:51 ` Jan Kara

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=07ab7f80-889e-4a28-adf9-12fc038bdc27@gmail.com \
    --to=yangyongpeng.storage@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=jack@suse.cz \
    --cc=linkinjeon@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=yangyongpeng@xiaomi.com \
    /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).