Commit 5e22eda7 authored by Baokun Li's avatar Baokun Li
Browse files

Revert "ext4: don't set SB_RDONLY after filesystem errors"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBEQJ3



--------------------------------

This reverts commit 88a5f8ce.

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: 88a5f8ce ("ext4: don't set SB_RDONLY after filesystem errors")
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
parent a15afed4
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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);