mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
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>
This commit is contained in:
parent
b00d209241
commit
c0ed7b51ca
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue