[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7ea5edb-834d-091a-efe6-7d15a5a55338@huaweicloud.com>
Date: Thu, 17 Aug 2023 10:48:51 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Theodore Ts'o <tytso@....edu>
Cc: adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/13] ext4: correct return value of ext4_convert_meta_bg
on 8/16/2023 11:00 AM, Theodore Ts'o wrote:
> On Thu, Jun 29, 2023 at 08:00:34PM +0800, Kemeng Shi wrote:
>> We return error in "ret", so collect previous error in "ret" instead
>> of "err" or previous error will be ignored.
>>
>> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
>> ---
>> fs/ext4/resize.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
>> index 7cbc695b7005..0b3d8c808de1 100644
>> --- a/fs/ext4/resize.c
>> +++ b/fs/ext4/resize.c
>> @@ -1984,8 +1984,8 @@ static int ext4_convert_meta_bg(struct super_block *sb, struct inode *inode)
>>
>> errout:
>> ret = ext4_journal_stop(handle);
>> - if (!err)
>> - err = ret;
>> + if (!ret)
>> + ret = err;
>> return ret;
>
> If there is a previous error in "err", I think we would want to
> prioritize returning that error, as opposed to the potential error
> from ext4_journal_stop(). So how about this instead?
>
> errout:
> ret = ext4_journal_stop(handle);
> if (!err)
> ret = err;
> return ret;
>
I think you mean:
errout:
ret = ext4_journal_stop(handle);
if (*err*)
ret = err;
return ret;
And I will fix in this way if I don't get wrong.
>
> - Ted
>
Powered by blists - more mailing lists