]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
jbd2: make sure ESHUTDOWN to be recorded in the journal superblock
authorzhangyi (F) <yi.zhang@huawei.com>
Wed, 4 Dec 2019 12:46:13 +0000 (20:46 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 7 Apr 2020 08:50:19 +0000 (10:50 +0200)
BugLink: https://bugs.launchpad.net/bugs/1867837
[ Upstream commit 0e98c084a21177ef136149c6a293b3d1eb33ff92 ]

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) <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191204124614.45424-4-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/jbd2/journal.c

index baf90ad95a999cf9023139e5535a17357bec799d..febac583cfe834b13ffdcdd5cb83a3e44c98a4d3 100644 (file)
@@ -2136,8 +2136,7 @@ static void __journal_abort_soft (journal_t *journal, int errno)
 
        if (journal->j_flags & JBD2_ABORT) {
                write_unlock(&journal->j_state_lock);
-               if (!old_errno && old_errno != -ESHUTDOWN &&
-                   errno == -ESHUTDOWN)
+               if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN)
                        jbd2_journal_update_sb_errno(journal);
                return;
        }