[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <630064d8-ea12-3bf3-bc33-c0e3a323118b@huawei.com>
Date: Fri, 4 Nov 2022 17:16:17 +0800
From: Jason Yan <yanaijie@...wei.com>
To: <tytso@....edu>, <adilger.kernel@...ger.ca>, <jack@...e.cz>,
<ritesh.list@...il.com>, <lczerner@...hat.com>,
<linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v2] ext4: fix wrong return err in
ext4_load_and_init_journal()
Hi Theodore,
I am sorry that this is a regression my patch introduced in 6.1-rc1. I
wonder if you can merge this fix for 6.1?
Thanks,
Jason
On 2022/10/25 12:02, Jason Yan wrote:
> The return value is wrong in ext4_load_and_init_journal(). The local
> variable 'err' need to be initialized before goto out. The original code
> in __ext4_fill_super() is fine because it has two return values 'ret'
> and 'err' and 'ret' is initialized as -EINVAL. After we factor out
> ext4_load_and_init_journal(), this code is broken. So fix it by directly
> returning -EINVAL in the error handler path.
>
> Fixes: 9c1dd22d7422 ("ext4: factor out ext4_load_and_init_journal()")
> Signed-off-by: Jason Yan <yanaijie@...wei.com>
> Reviewed-by: Jan Kara <jack@...e.cz>
> ---
> v2: Change fixes tag format and add Jan's tag (thanks Jan).
>
> 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 989365b878a6..89c6bad28a8a 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4885,7 +4885,7 @@ static int ext4_load_and_init_journal(struct super_block *sb,
> flush_work(&sbi->s_error_work);
> jbd2_journal_destroy(sbi->s_journal);
> sbi->s_journal = NULL;
> - return err;
> + return -EINVAL;
> }
>
> static int ext4_journal_data_mode_check(struct super_block *sb)
>
Powered by blists - more mailing lists