Re: [PATCH v5 3/5] isofs: check the return value of sb_min_blocksize() in isofs_fill_super

Yongpeng Yang
2025-11-04T11:32:14Z

On 11/4/25 19:02, Christoph Hellwig wrote:
> On Tue, Nov 04, 2025 at 12:47:21AM +0800, Yongpeng Yang wrote:
>> From: Yongpeng Yang <yangyongpeng@xiaomi.com>
>>
>> sb_min_blocksize() may return 0. Check its return value to avoid
>> opt->blocksize and sb->s_blocksize is 0.
>>
>> Cc: <stable@vger.kernel.org> # v6.15
>> Fixes: 1b17a46c9243e9 ("isofs: convert isofs to use the new mount API")
>> Reviewed-by: Jan Kara <jack@suse.cz>
>> Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
>> ---
>> fs/isofs/inode.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
>> index 6f0e6b19383c..ad3143d4066b 100644
>> --- a/fs/isofs/inode.c
>> +++ b/fs/isofs/inode.c
>> @@ -610,6 +610,11 @@ static int isofs_fill_super(struct super_block *s, struct fs_context *fc)
>> goto out_freesbi;
>> }
>> opt->blocksize = sb_min_blocksize(s, opt->blocksize);
>> + if (!opt->blocksize) {
>> + printk(KERN_ERR
>
> This should probably use pr_err instead.
>

Thanks for the review. The other functions in fs/isofs/inode.c use
"printk(KERN_ERR|KERN_DEBUG|KERN_WARNING ...)", so I used
"printk(KERN_ERR ...)" for consistency.

Yongpeng,