]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ext2: avoid unnecessary operation in ext2_error()
authorChengguang Xu <cgxu519@gmx.com>
Wed, 7 Nov 2018 13:47:04 +0000 (21:47 +0800)
committerJan Kara <jack@suse.cz>
Thu, 8 Nov 2018 14:14:48 +0000 (15:14 +0100)
If filesystem has already mounted as read-only, then we don't have
to do it again.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/super.c

index cb91baa4275d8150664e05d8a1877ca87fca4ff9..5e2861b947a63a0008daa0685ce805058478e772 100644 (file)
@@ -73,7 +73,7 @@ void ext2_error(struct super_block *sb, const char *function,
 
        if (test_opt(sb, ERRORS_PANIC))
                panic("EXT2-fs: panic from previous error\n");
-       if (test_opt(sb, ERRORS_RO)) {
+       if (!sb_rdonly(sb) && test_opt(sb, ERRORS_RO)) {
                ext2_msg(sb, KERN_CRIT,
                             "error: remounting filesystem read-only");
                sb->s_flags |= SB_RDONLY;