mirror of
https://github.com/torvalds/linux
synced 2024-10-16 16:29:20 +00:00
bcachefs: drop journal lock before calling journal_write
bch2_journal_write() expects process context, it takes journal_lock as needed. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
4b33a1916a
commit
cfda31c033
|
@ -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,10 +1567,11 @@ 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);
|
||||
}
|
||||
|
||||
spin_unlock(&j->lock);
|
||||
}
|
||||
|
||||
static void journal_write_endio(struct bio *bio)
|
||||
|
|
Loading…
Reference in a new issue