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

bcachefs: Fix unhandled transaction restart in bch2_gc_btree_gens()

This fixes https://github.com/koverstreet/bcachefs/issues/305Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 8dd6ed94
......@@ -1736,8 +1736,14 @@ static int bch2_gc_btree_gens(struct bch_fs *c, enum btree_id btree_id)
BTREE_ITER_ALL_SNAPSHOTS);
while ((bch2_trans_begin(&trans),
k = bch2_btree_iter_peek(iter)).k &&
!(ret = bkey_err(k))) {
k = bch2_btree_iter_peek(iter)).k) {
ret = bkey_err(k);
if (ret == -EINTR)
continue;
if (ret)
break;
c->gc_gens_pos = iter->pos;
if (gc_btree_gens_key(c, k) && !commit_err) {
......
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