1 jbd2: if the journal is aborted then don't allow update of the log tail
3 This updates the jbd2 superblock unnecessarily, and on an abort we
4 shouldn't truncate the log.
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 Cc: stable@vger.kernel.org
10 fs/jbd2/journal.c | 5 ++++-
11 1 file changed, 4 insertions(+), 1 deletion(-)
13 diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
14 index efa0c72a0b9f..dfb057900e79 100644
15 --- a/fs/jbd2/journal.c
16 +++ b/fs/jbd2/journal.c
17 @@ -974,7 +974,7 @@ int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block)
21 - * This is a variaon of __jbd2_update_log_tail which checks for validity of
22 + * This is a variation of __jbd2_update_log_tail which checks for validity of
23 * provided log tail and locks j_checkpoint_mutex. So it is safe against races
24 * with other threads updating log tail.
26 @@ -1417,6 +1417,9 @@ int jbd2_journal_update_sb_log_tail(journal_t *journal, tid_t tail_tid,
27 journal_superblock_t *sb = journal->j_superblock;
30 + if (is_journal_aborted(journal))
33 BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
34 jbd_debug(1, "JBD2: updating superblock (start %lu, seq %u)\n",
35 tail_block, tail_tid);