Skip to contentSkip to conversation

ext4: Avoid panic during forced reboot due to aborted journal

PATCH Applied Jan Kara 2 participants 2 messages May 15, 2019 – May 17, 2019 ext4 file system

lore
Share & tools
lore

Jan Kara

author reviewer
#0 lore raw

PATCH 1/1 ext4: Avoid panic during forced reboot due to aborted journal

Handling of aborted journal is a special code path different from standard ext4_error() one and it can call panic() as well. Commit 1dc1097ff60e ("ext4: avoid panic during forced reboot") forgot to update this path so fix that omission.

Fixes 1dc1097ff60e ("ext4: avoid panic during forced reboot")
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/super.c +1 -1
index f71b5254a990..f48955bbf9d7 100644
@@ -699,7 +699,7 @@ void __ext4_abort(struct super_block *sb, const char *function,
 			jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO);
 		save_error_info(sb, function, line);
 	}
-	if (test_opt(sb, ERRORS_PANIC)) {
+	if (test_opt(sb, ERRORS_PANIC) && !system_going_down()) {
 		if (EXT4_SB(sb)->s_journal &&
 		  !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR))
 			return;
Signature · 1 line
2.16.4
maintainer Applied
#1 lore raw
Quoted 7 lines · Jan Kara

Handling of aborted journal is a special code path different from standard ext4_error() one and it can call panic() as well. Commit 1dc1097ff60e ("ext4: avoid panic during forced reboot") forgot to update this path so fix that omission.

Fixes 1dc1097ff60e ("ext4: avoid panic during forced reboot")

Thanks, applied.

- Ted