diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 90d6091d7e187..9ffb19cf376b4 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -285,9 +285,10 @@ int jbd2_log_do_checkpoint(journal_t *journal) if (unlikely(buffer_write_io_error(bh)) && !result) result = -EIO; BUFFER_TRACE(bh, "remove from checkpoint"); - __jbd2_journal_remove_checkpoint(jh); - spin_unlock(&journal->j_list_lock); - goto retry; + if (__jbd2_journal_remove_checkpoint(jh)) + /* The transaction was released; we're done */ + goto out; + continue; } /* * Important: we are about to write the buffer, and