Commit 4fe7efa1 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix an error path

We were missing a 'goto retry' and continuing on with an error pointer.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 988e98cf
...@@ -1869,7 +1869,7 @@ int bch2_btree_node_update_key(struct bch_fs *c, struct btree_iter *iter, ...@@ -1869,7 +1869,7 @@ int bch2_btree_node_update_key(struct bch_fs *c, struct btree_iter *iter,
new_hash = bch2_btree_node_mem_alloc(c); new_hash = bch2_btree_node_mem_alloc(c);
} }
retry:
as = bch2_btree_update_start(iter->trans, iter->btree_id, as = bch2_btree_update_start(iter->trans, iter->btree_id,
parent ? btree_update_reserve_required(c, parent) : 0, parent ? btree_update_reserve_required(c, parent) : 0,
BTREE_INSERT_NOFAIL| BTREE_INSERT_NOFAIL|
...@@ -1882,16 +1882,17 @@ int bch2_btree_node_update_key(struct bch_fs *c, struct btree_iter *iter, ...@@ -1882,16 +1882,17 @@ int bch2_btree_node_update_key(struct bch_fs *c, struct btree_iter *iter,
if (ret == -EAGAIN) if (ret == -EAGAIN)
ret = -EINTR; ret = -EINTR;
if (ret != -EINTR) if (ret == -EINTR) {
goto err; bch2_trans_unlock(iter->trans);
up_read(&c->gc_lock);
closure_sync(&cl);
down_read(&c->gc_lock);
bch2_trans_unlock(iter->trans); if (bch2_trans_relock(iter->trans))
up_read(&c->gc_lock); goto retry;
closure_sync(&cl); }
down_read(&c->gc_lock);
if (!bch2_trans_relock(iter->trans)) goto err;
goto err;
} }
ret = bch2_mark_bkey_replicas(c, bkey_i_to_s_c(new_key)); ret = bch2_mark_bkey_replicas(c, bkey_i_to_s_c(new_key));
......
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