Skip to content

Commit

Permalink
ext4: move ext4_check_bdev_write_error() into nojournal mode
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20231213013224.2100050-6-chengzhihao1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Zhihao Cheng authored and Theodore Ts'o committed Jan 5, 2024
1 parent b4e73e6 commit ada3fb8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/ext4/ext4_jbd2.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,15 @@ 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) {
ext4_journal_abort_handle(where, line, __func__, bh,
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);
Expand Down

0 comments on commit ada3fb8

Please sign in to comment.