Unverified Commit dccd6d84 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13308 ext4: don't set SB_RDONLY after filesystem errors

parents 7161eccc 88a5f8ce
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -821,11 +821,12 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,

	ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
	/*
	 * Make sure updated value of ->s_mount_flags will be visible before
	 * ->s_flags update
	 * 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.
	 */
	smp_wmb();
	sb->s_flags |= SB_RDONLY;
#ifdef CONFIG_EXT4_ERROR_REPORT
out:
	ext4_netlink_send_info(sb, force_ro ? 2 : 1);