diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index b35f0b63baf0ec844ca5e1b65454e6e2fbcf9fe7..ab6c0b9c5336b111ed4c497eabc5eca356017157 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -96,8 +96,11 @@ void __jbd2_log_wait_for_space(journal_t *journal) 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 4462b6ec32b7c44f0388e84d8fe8fe05542d9b6e..bf83e1c64aa4803bc3b6ac9071fd9bc3a5511550 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1431,6 +1431,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; }