Skip to content

Commit ada3fb8

Browse files
Zhihao Chengtytso
authored andcommitted
ext4: move ext4_check_bdev_write_error() into nojournal mode
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 <[email protected]> Suggested-by: Jan Kara <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent b4e73e6 commit ada3fb8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/ext4/ext4_jbd2.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,15 @@ int __ext4_journal_get_write_access(const char *where, unsigned int line,
235235

236236
might_sleep();
237237

238-
ext4_check_bdev_write_error(sb);
239-
240238
if (ext4_handle_valid(handle)) {
241239
err = jbd2_journal_get_write_access(handle, bh);
242240
if (err) {
243241
ext4_journal_abort_handle(where, line, __func__, bh,
244242
handle, err);
245243
return err;
246244
}
247-
}
245+
} else
246+
ext4_check_bdev_write_error(sb);
248247
if (trigger_type == EXT4_JTR_NONE || !ext4_has_metadata_csum(sb))
249248
return 0;
250249
BUG_ON(trigger_type >= EXT4_JOURNAL_TRIGGER_COUNT);

0 commit comments

Comments
 (0)