
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBEQJ3 -------------------------------- This reverts commit 88a5f8ce0c0bce7d85d112a8ca819557d428e50f. Because this patch causes the file system to be displayed as rw by mount when an error is triggered in 'errors=remount-ro' mode. The issue this patch was intended to fix has been resolved by 'fs: fix a hungtask problem when freeze/unfreeze fs', therefore it can be safely reverted. Fixes: 88a5f8ce0c0b ("ext4: don't set SB_RDONLY after filesystem errors") Signed-off-by: Baokun Li <libaokun1@huawei.com> --- fs/ext4/super.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 84bee249657d..92e3476d4fe0 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -821,12 +821,11 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error, ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only"); /* - * EXT4_FLAGS_SHUTDOWN was set which stops all filesystem - * modifications. We don't set SB_RDONLY because that requires - * sb->s_umount semaphore and setting it without proper remount - * procedure is confusing code such as freeze_super() leading to - * deadlocks and other problems. + * Make sure updated value of ->s_mount_flags will be visible before + * ->s_flags update */ + smp_wmb(); + sb->s_flags |= SB_RDONLY; #ifdef CONFIG_EXT4_ERROR_REPORT out: ext4_netlink_send_info(sb, force_ro ? 2 : 1); -- 2.46.1