diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e1f99fa9a6d02ed890e40d0dae0bd3649c94bce1..d721c0e9d382068dae0e6708730b22f99e6736b7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -742,11 +742,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; out: ext4_netlink_send_info(sb, force_ro ? 2 : 1); }