Skip to content

Commit 0435773

Browse files
author
Kent Overstreet
committed
bcachefs: Fix journal getting stuck on a flush commit
silly race Signed-off-by: Kent Overstreet <[email protected]>
1 parent a2d23f3 commit 0435773

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/bcachefs/journal_io.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,11 +1762,13 @@ static CLOSURE_CALLBACK(journal_write_preflush)
17621762

17631763
if (j->seq_ondisk + 1 != le64_to_cpu(w->data->seq)) {
17641764
spin_lock(&j->lock);
1765-
closure_wait(&j->async_wait, cl);
1765+
if (j->seq_ondisk + 1 != le64_to_cpu(w->data->seq)) {
1766+
closure_wait(&j->async_wait, cl);
1767+
spin_unlock(&j->lock);
1768+
continue_at(cl, journal_write_preflush, j->wq);
1769+
return;
1770+
}
17661771
spin_unlock(&j->lock);
1767-
1768-
continue_at(cl, journal_write_preflush, j->wq);
1769-
return;
17701772
}
17711773

17721774
if (w->separate_flush) {

0 commit comments

Comments
 (0)