Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Chengguang Xu and committed by
Jan Kara
c0ed7b51 b00d2092

+1 -1
+1 -1
fs/ext2/super.c
··· 73 73 74 74 if (test_opt(sb, ERRORS_PANIC)) 75 75 panic("EXT2-fs: panic from previous error\n"); 76 - if (test_opt(sb, ERRORS_RO)) { 76 + if (!sb_rdonly(sb) && test_opt(sb, ERRORS_RO)) { 77 77 ext2_msg(sb, KERN_CRIT, 78 78 "error: remounting filesystem read-only"); 79 79 sb->s_flags |= SB_RDONLY;