Skip to content

Commit 85e0c4e

Browse files
committed
jbd2: if the journal is aborted then don't allow update of the log tail
This updates the jbd2 superblock unnecessarily, and on an abort we shouldn't truncate the log. Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected]
1 parent fb7c024 commit 85e0c4e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/jbd2/journal.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block)
974974
}
975975

976976
/*
977-
* This is a variaon of __jbd2_update_log_tail which checks for validity of
977+
* This is a variation of __jbd2_update_log_tail which checks for validity of
978978
* provided log tail and locks j_checkpoint_mutex. So it is safe against races
979979
* with other threads updating log tail.
980980
*/
@@ -1417,6 +1417,9 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
14171417
journal_superblock_t *sb = journal->j_superblock;
14181418
int ret;
14191419

1420+
if (is_journal_aborted(journal))
1421+
return -EIO;
1422+
14201423
BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
14211424
jbd_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n",
14221425
tail_block, tail_tid);

0 commit comments

Comments
 (0)