[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa39f223-cc1a-eaa0-34a9-29a3ec2491ef@huawei.com>
Date: Thu, 1 Sep 2022 15:42:35 +0800
From: Jason Yan <yanaijie@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: <tytso@....edu>, <adilger.kernel@...ger.ca>,
<ritesh.list@...il.com>, <lczerner@...hat.com>,
<linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 02/13] ext4: remove cantfind_ext4 error handler
On 2022/8/31 19:41, Jan Kara wrote:
> On Tue 30-08-22 20:04:00, Jason Yan wrote:
>> The 'cantfind_ext4' error handler is just a error msg print and then
>> goto failed_mount. This two level goto makes the code complex and not
>> easy to read. The only benefit is that is saves a little bit code.
>> However some branches can merge and some branches dot not even need it.
>> So do some refactor and remove it.
>>
>> Signed-off-by: Jason Yan <yanaijie@...wei.com>
>
> Yeah, probably makes sense. Just small style nits below. Feel free to add:
>
> Reviewed-by: Jan Kara <jack@...e.cz>
>
>> @@ -4798,8 +4800,11 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
>> sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
>>
>> sbi->s_inodes_per_block = blocksize / EXT4_INODE_SIZE(sb);
>> - if (sbi->s_inodes_per_block == 0)
>> - goto cantfind_ext4;
>> + if (sbi->s_inodes_per_block == 0 || (EXT4_BLOCKS_PER_GROUP(sb) == 0)) {
>
> I'd write this as:
>
> if (sbi->s_inodes_per_block == 0 || sbi->s_blocks_per_group == 0) {
>
> to avoid superfluous braces and make the code a bit more natural.
>
> Honza
Good suggestion. Will update.
Thanks.
Powered by blists - more mailing lists