Commit c0ed7b51 authored by Chengguang Xu's avatar Chengguang Xu Committed by Jan Kara

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: default avatarChengguang Xu <cgxu519@gmx.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent b00d2092
...@@ -73,7 +73,7 @@ void ext2_error(struct super_block *sb, const char *function, ...@@ -73,7 +73,7 @@ void ext2_error(struct super_block *sb, const char *function,
if (test_opt(sb, ERRORS_PANIC)) if (test_opt(sb, ERRORS_PANIC))
panic("EXT2-fs: panic from previous error\n"); 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, ext2_msg(sb, KERN_CRIT,
"error: remounting filesystem read-only"); "error: remounting filesystem read-only");
sb->s_flags |= SB_RDONLY; sb->s_flags |= SB_RDONLY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment