diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index b7e1a2bdd7fbd87b04588c6bb8bd842c2a254cc4..727f3505280c585c7b0ad9683b242ccf57398726 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -98,8 +98,11 @@ __releases(&journal->j_state_lock) write_unlock(&journal->j_state_lock); if (chkpt) { jbd2_log_do_checkpoint(journal); - } else if (jbd2_cleanup_journal_tail(journal) == 0) { - /* We were able to recover space; yay! */ + } else if (jbd2_cleanup_journal_tail(journal) <= 0) { + /* + * We were able to recover space or the + * journal was aborted due to an error. + */ ; } else if (tid) { /* diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 6e2848b10aaf9ed928896485589b3f8dfed3ad64..7775ad53b291120c2e3570d2671c5d3d8431561b 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1621,6 +1621,8 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags) /* Buffer got discarded which means block device got invalidated */ if (!buffer_mapped(bh)) { unlock_buffer(bh); + if (!is_journal_aborted(journal)) + jbd2_journal_abort(journal, -EIO); return -EIO; }