Commit 04357732 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix journal getting stuck on a flush commit



silly race

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a2d23f3d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1762,12 +1762,14 @@ static CLOSURE_CALLBACK(journal_write_preflush)

	if (j->seq_ondisk + 1 != le64_to_cpu(w->data->seq)) {
		spin_lock(&j->lock);
		if (j->seq_ondisk + 1 != le64_to_cpu(w->data->seq)) {
			closure_wait(&j->async_wait, cl);
			spin_unlock(&j->lock);

			continue_at(cl, journal_write_preflush, j->wq);
			return;
		}
		spin_unlock(&j->lock);
	}

	if (w->separate_flush) {
		for_each_rw_member(c, ca) {