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

bcachefs: drop journal lock before calling journal_write



bch2_journal_write() expects process context, it takes journal_lock as
needed.

Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 4b33a191
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1554,6 +1554,7 @@ static void journal_write_done(struct closure *cl)

	if (!journal_state_count(new, new.unwritten_idx) &&
	    journal_last_unwritten_seq(j) <= journal_cur_seq(j)) {
		spin_unlock(&j->lock);
		closure_call(&j->io, bch2_journal_write, c->io_complete_wq, NULL);
	} else if (journal_last_unwritten_seq(j) == journal_cur_seq(j) &&
		   new.cur_entry_offset < JOURNAL_ENTRY_CLOSED_VAL) {
@@ -1566,11 +1567,12 @@ static void journal_write_done(struct closure *cl)
		 * might want to be written now:
		 */

		spin_unlock(&j->lock);
		mod_delayed_work(c->io_complete_wq, &j->write_work, max(0L, delta));
	}

	} else {
		spin_unlock(&j->lock);
	}
}

static void journal_write_endio(struct bio *bio)
{