Skip to content

Commit 0e98c08

Browse files
zhangyi089tytso
authored andcommitted
jbd2: make sure ESHUTDOWN to be recorded in the journal superblock
Commit fb7c024 ("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: fb7c024 ("ext4: pass -ESHUTDOWN code to jbd2 layer") Signed-off-by: zhangyi (F) <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 51f57b0 commit 0e98c08

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/jbd2/journal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,8 +2147,7 @@ static void __journal_abort_soft (journal_t *journal, int errno)
21472147

21482148
if (journal->j_flags & JBD2_ABORT) {
21492149
write_unlock(&journal->j_state_lock);
2150-
if (!old_errno && old_errno != -ESHUTDOWN &&
2151-
errno == -ESHUTDOWN)
2150+
if (old_errno != -ESHUTDOWN && errno == -ESHUTDOWN)
21522151
jbd2_journal_update_sb_errno(journal);
21532152
return;
21542153
}

0 commit comments

Comments
 (0)