Skip to content

Commit 79055f5

Browse files
author
Kent Overstreet
committed
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>
1 parent fabb4d4 commit 79055f5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/bcachefs/recovery.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ int bch2_journal_replay(struct bch_fs *c)
249249

250250
struct journal_key *k = *kp;
251251

252-
replay_now_at(j, k->journal_seq);
252+
if (k->journal_seq)
253+
replay_now_at(j, k->journal_seq);
254+
else
255+
replay_now_at(j, j->replay_journal_seq_end);
253256

254257
ret = commit_do(trans, NULL, NULL,
255258
BCH_TRANS_COMMIT_no_enospc|

0 commit comments

Comments
 (0)