From: Kent Overstreet Date: Tue, 16 Apr 2024 03:53:12 +0000 (-0400) Subject: bcachefs: make sure to release last journal pin in replay X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=79055f50a65fe5eb58e9da1f79fb0a4f4bc82fff;p=linux.git 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 --- diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 0f328aba9760b..be5b476193270 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -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|