linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ext4: Fix fs can't panic when abort by user
@ 2021-04-01  8:19 Ye Bin
  2021-04-09 21:28 ` Theodore Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Ye Bin @ 2021-04-01  8:19 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4, linux-kernel; +Cc: Ye Bin

Test steps:
1. mount /dev/sda -o errors=panic test
2. mount /dev/sda -o remount,ro test
3. mount /dev/sda -o remount,abort test

Before 014c9caa29d3 not been merged there will trigger panic. But
014c9caa29d3 change this behavior.

Fixes: 014c9caa29d3 ("ext4: make ext4_abort() use __ext4_error()")
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 fs/ext4/super.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b9693680463a..acb75dc396f8 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -667,9 +667,6 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
 			ext4_commit_super(sb);
 	}
 
-	if (sb_rdonly(sb) || continue_fs)
-		return;
-
 	/*
 	 * We force ERRORS_RO behavior when system is rebooting. Otherwise we
 	 * could panic during 'reboot -f' as the underlying device got already
@@ -679,6 +676,10 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
 		panic("EXT4-fs (device %s): panic forced after error\n",
 			sb->s_id);
 	}
+
+	if (sb_rdonly(sb) || continue_fs)
+		return;
+
 	ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
 	/*
 	 * Make sure updated value of ->s_mount_flags will be visible before
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-09 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01  8:19 [RFC] ext4: Fix fs can't panic when abort by user Ye Bin
2021-04-09 21:28 ` Theodore Ts'o
2021-04-09 22:41   ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).