Linux EXT4 FS development
 help / color / mirror / Atom feed
From: Zhihao Cheng <chengzhihao1@huawei.com>
To: <tytso@mit.edu>, <jack@suse.com>
Cc: <linux-ext4@vger.kernel.org>, <chengzhihao1@huawei.com>,
	<yi.zhang@huawei.com>
Subject: [PATCH 5/5] ext4: Move ext4_check_bdev_write_error() into nojournal mode
Date: Fri, 3 Nov 2023 22:52:50 +0800	[thread overview]
Message-ID: <20231103145250.2995746-6-chengzhihao1@huawei.com> (raw)
In-Reply-To: <20231103145250.2995746-1-chengzhihao1@huawei.com>

Since JBD2 takes care of all metadata writeback errors of fs dev,
ext4_check_bdev_write_error() is useful only in nojournal mode.
Move it into '!ext4_handle_valid(handle)' branch.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Suggested-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/ext4_jbd2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index d1a2e6624401..5d8055161acd 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -235,8 +235,6 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line,
 
 	might_sleep();
 
-	ext4_check_bdev_write_error(sb);
-
 	if (ext4_handle_valid(handle)) {
 		err = jbd2_journal_get_write_access(handle, bh);
 		if (err) {
@@ -244,7 +242,8 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line,
 						  handle, err);
 			return err;
 		}
-	}
+	} else
+		ext4_check_bdev_write_error(sb);
 	if (trigger_type == EXT4_JTR_NONE || !ext4_has_metadata_csum(sb))
 		return 0;
 	BUG_ON(trigger_type >= EXT4_JOURNAL_TRIGGER_COUNT);
-- 
2.39.2


  parent reply	other threads:[~2023-11-03  6:58 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
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 ` Zhihao Cheng [this message]
2023-12-12 14:38   ` [PATCH 5/5] ext4: Move ext4_check_bdev_write_error() into nojournal mode 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=20231103145250.2995746-6-chengzhihao1@huawei.com \
    --to=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