[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <287af40c-4ac9-d773-830a-6daa1f16102a@huawei.com>
Date: Thu, 2 Mar 2023 09:26:10 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Ye Bin <yebin@...weicloud.com>, <tytso@....edu>,
<adilger.kernel@...ger.ca>, <linux-ext4@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>, <jack@...e.cz>,
Ye Bin <yebin10@...wei.com>
Subject: Re: [PATCH v4 2/2] ext4: make sure fs error flag setted before clear
journal error
On 2023/3/1 19:59, Ye Bin wrote:
> From: Ye Bin <yebin10@...wei.com>
>
> Now, jounral error number maybe cleared even though ext4_commit_super()
> failed. This may lead to error flag miss, then fsck will miss to check
> file system deeply.
>
> Signed-off-by: Ye Bin <yebin10@...wei.com>
> Reviewed-by: Jan Kara <jack@...e.cz>
Looks good to me.
Reviewed-by: Baokun Li <libaokun1@...wei.com>
> ---
> fs/ext4/super.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 9df8fada2dce..7736c96d5a78 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -6152,11 +6152,13 @@ static int ext4_clear_journal_err(struct super_block *sb,
> errstr = ext4_decode_error(sb, j_errno, nbuf);
> ext4_warning(sb, "Filesystem error recorded "
> "from previous mount: %s", errstr);
> - ext4_warning(sb, "Marking fs in need of filesystem check.");
>
> EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
> es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
> - ext4_commit_super(sb);
> + j_errno = ext4_commit_super(sb);
> + if (j_errno)
> + return j_errno;
> + ext4_warning(sb, "Marked fs in need of filesystem check.");
>
> jbd2_journal_clear_err(journal);
> jbd2_journal_update_sb_errno(journal);
--
With Best Regards,
Baokun Li
.
Powered by blists - more mailing lists