bcachefs: make sure to release last journal pin in replay

This fixes a deadlock when journal replay has many keys to insert that
were from fsck, not the journal.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-04-15 23:53:12 -04:00
parent fabb4d4985
commit 79055f50a6
1 changed files with 4 additions and 1 deletions

View File

@ -249,7 +249,10 @@ int bch2_journal_replay(struct bch_fs *c)
struct journal_key *k = *kp;
replay_now_at(j, k->journal_seq);
if (k->journal_seq)
replay_now_at(j, k->journal_seq);
else
replay_now_at(j, j->replay_journal_seq_end);
ret = commit_do(trans, NULL, NULL,
BCH_TRANS_COMMIT_no_enospc|