blob: 216fb96512d25e32ce5c8d3c1f83885dab1efb1a [file] [log] [blame]
From 0a52bffac275e5a2049d1b76f97aabccb8d9beac Mon Sep 17 00:00:00 2001
From: "zhangyi (F)" <>
Date: Wed, 4 Dec 2019 20:46:13 +0800
Subject: [PATCH] jbd2: make sure ESHUTDOWN to be recorded in the journal
commit 0e98c084a21177ef136149c6a293b3d1eb33ff92 upstream.
Commit fb7c02445c49 ("ext4: pass -ESHUTDOWN code to jbd2 layer") want
to allow jbd2 layer to distinguish shutdown journal abort from other
error cases. So the ESHUTDOWN should be taken precedence over any other
errno which has already been recoded after EXT4_FLAGS_SHUTDOWN is set,
but it only update errno in the journal suoerblock now if the old errno
is 0.
Fixes: fb7c02445c49 ("ext4: pass -ESHUTDOWN code to jbd2 layer")
Signed-off-by: zhangyi (F) <>
Reviewed-by: Jan Kara <>
Signed-off-by: Theodore Ts'o <>
Signed-off-by: Paul Gortmaker <>
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 18e0e8e26e8b..897760b69866 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2119,8 +2119,7 @@ static void __journal_abort_soft (journal_t *journal, int errno)
if (journal->j_flags & JBD2_ABORT) {
- if (!old_errno && old_errno != -ESHUTDOWN &&
- errno == -ESHUTDOWN)
+ if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN)