Commit f6d0368e authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Traverse iterator in journal replay

This fixes a bug where we end up spinning in journal replay - in theory
this shouldn't be necessary though, transaction reset should be
re-traversing all iterators.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a7b46a3d
......@@ -417,15 +417,17 @@ static int __bch2_journal_replay_key(struct btree_trans *trans,
enum btree_id id, struct bkey_i *k)
{
struct btree_iter *iter;
int ret;
iter = bch2_trans_get_iter(trans, id, bkey_start_pos(&k->k),
BTREE_ITER_INTENT);
if (IS_ERR(iter))
return PTR_ERR(iter);
bch2_trans_update(trans, iter, k, BTREE_TRIGGER_NORUN);
ret = bch2_btree_iter_traverse(iter) ?:
bch2_trans_update(trans, iter, k, BTREE_TRIGGER_NORUN);
bch2_trans_iter_put(trans, iter);
return 0;
return ret;
}
static int bch2_journal_replay_key(struct bch_fs *c, enum btree_id id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment