diff options
author | Chengguang Xu <cgxu519@gmx.com> | 2018-11-07 21:47:04 +0800 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2018-11-08 15:14:48 +0100 |
commit | c0ed7b51ca9983086e03668f0ca20dc67ac663f4 (patch) | |
tree | 4bc3adfa25c3d34dccd878cce659cb8c0a5b611c /fs/ext2/super.c | |
parent | b00d209241ff7ac336543f92ea764b9d6b03032a (diff) | |
download | linux-c0ed7b51ca9983086e03668f0ca20dc67ac663f4.tar.bz2 |
ext2: avoid unnecessary operation in ext2_error()
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>
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r-- | fs/ext2/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index cb91baa4275d..5e2861b947a6 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -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; |