diff options
Diffstat (limited to 'kernel/fs/jbd2/journal.c')
-rw-r--r-- | kernel/fs/jbd2/journal.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/fs/jbd2/journal.c b/kernel/fs/jbd2/journal.c index 112fad9e1..7003c0925 100644 --- a/kernel/fs/jbd2/journal.c +++ b/kernel/fs/jbd2/journal.c @@ -1708,8 +1708,17 @@ int jbd2_journal_destroy(journal_t *journal) while (journal->j_checkpoint_transactions != NULL) { spin_unlock(&journal->j_list_lock); mutex_lock(&journal->j_checkpoint_mutex); - jbd2_log_do_checkpoint(journal); + err = jbd2_log_do_checkpoint(journal); mutex_unlock(&journal->j_checkpoint_mutex); + /* + * If checkpointing failed, just free the buffers to avoid + * looping forever + */ + if (err) { + jbd2_journal_destroy_checkpoint(journal); + spin_lock(&journal->j_list_lock); + break; + } spin_lock(&journal->j_list_lock); } |