summaryrefslogtreecommitdiff
path: root/fs/ext2
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-11-07 21:47:04 +0800
committerJan Kara <jack@suse.cz>2018-11-08 15:14:48 +0100
commitc0ed7b51ca9983086e03668f0ca20dc67ac663f4 (patch)
tree4bc3adfa25c3d34dccd878cce659cb8c0a5b611c /fs/ext2
parentb00d209241ff7ac336543f92ea764b9d6b03032a (diff)
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')
-rw-r--r--fs/ext2/super.c2
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;