]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ext4: move ext4_check_bdev_write_error() into nojournal mode
authorZhihao Cheng <chengzhihao1@huawei.com>
Wed, 13 Dec 2023 01:32:24 +0000 (09:32 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 5 Jan 2024 04:42:21 +0000 (23:42 -0500)
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>
fs/ext4/ext4_jbd2.c

index d1a2e662440178e87c8240a1fa70f5cdf4731cef..5d8055161acdb5d85375f2dacb4706ea6ef14fa4 100644 (file)
@@ -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);