From: Jan Kara <jack@suse.cz>
To: Zhihao Cheng <chengzhihao1@huawei.com>
Cc: tytso@mit.edu, jack@suse.com, linux-ext4@vger.kernel.org,
yi.zhang@huawei.com
Subject: Re: [PATCH 2/5] jbd2: Replace journal state flag by checking errseq
Date: Tue, 12 Dec 2023 15:37:04 +0100 [thread overview]
Message-ID: <20231212143704.5sf3nrluy2klx7d4@quack3> (raw)
In-Reply-To: <20231103145250.2995746-3-chengzhihao1@huawei.com>
On Fri 03-11-23 22:52:47, Zhihao Cheng wrote:
> Now JBD2 detects metadata writeback error of fs dev according to errseq.
> Replace journal state flag by checking errseq.
>
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> Suggested-by: Jan Kara <jack@suse.cz>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/jbd2/journal.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
> index a655d9a88f79..b60d19505f8a 100644
> --- a/fs/jbd2/journal.c
> +++ b/fs/jbd2/journal.c
> @@ -1850,7 +1850,7 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
>
> if (is_journal_aborted(journal))
> return -EIO;
> - if (test_bit(JBD2_CHECKPOINT_IO_ERROR, &journal->j_atomic_flags)) {
> + if (jbd2_check_fs_dev_write_error(journal)) {
> jbd2_journal_abort(journal, -EIO);
> return -EIO;
> }
> @@ -2148,12 +2148,12 @@ int jbd2_journal_destroy(journal_t *journal)
>
> /*
> * OK, all checkpoint transactions have been checked, now check the
> - * write out io error flag and abort the journal if some buffer failed
> - * to write back to the original location, otherwise the filesystem
> - * may become inconsistent.
> + * writeback errseq of fs dev and abort the journal if some buffer
> + * failed to write back to the original location, otherwise the
> + * filesystem may become inconsistent.
> */
> if (!is_journal_aborted(journal) &&
> - test_bit(JBD2_CHECKPOINT_IO_ERROR, &journal->j_atomic_flags))
> + jbd2_check_fs_dev_write_error(journal))
> jbd2_journal_abort(journal, -EIO);
>
> if (journal->j_sb_buffer) {
> --
> 2.39.2
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-12-12 14:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 14:52 [PATCH 0/5] jbd2: Add errseq to detect writeback Zhihao Cheng
2023-11-03 14:52 ` [PATCH 1/5] jbd2: Add errseq to detect client fs's bdev writeback error Zhihao Cheng
2023-12-12 14:36 ` Jan Kara
2023-11-03 14:52 ` [PATCH 2/5] jbd2: Replace journal state flag by checking errseq Zhihao Cheng
2023-12-12 14:37 ` Jan Kara [this message]
2023-11-03 14:52 ` [PATCH 3/5] jbd2: Remove unused 'JBD2_CHECKPOINT_IO_ERROR' and 'j_atomic_flags' Zhihao Cheng
2023-12-12 14:37 ` Jan Kara
2023-11-03 14:52 ` [PATCH 4/5] jbd2: Abort journal when detecting metadata writeback error of fs dev Zhihao Cheng
2023-12-12 14:38 ` Jan Kara
2023-11-03 14:52 ` [PATCH 5/5] ext4: Move ext4_check_bdev_write_error() into nojournal mode Zhihao Cheng
2023-12-12 14:38 ` Jan Kara
2023-11-22 13:02 ` [PATCH 0/5] jbd2: Add errseq to detect writeback Zhang Yi
2023-12-12 14:39 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231212143704.5sf3nrluy2klx7d4@quack3 \
--to=jack@suse.cz \
--cc=chengzhihao1@huawei.com \
--cc=jack@suse.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox