Commit 3e36e572 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix an unhandled transaction restart error

This is a bit awkward: we're passing around a btree_trans, but we're not
in a context where transaction restarts are handled - we should try to
come up with a better way to denote situations like this.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent dc6274bc
...@@ -713,6 +713,11 @@ int __bch2_evacuate_bucket(struct btree_trans *trans, ...@@ -713,6 +713,11 @@ int __bch2_evacuate_bucket(struct btree_trans *trans,
bch2_bkey_buf_init(&sk); bch2_bkey_buf_init(&sk);
/*
* We're not run in a context that handles transaction restarts:
*/
bch2_trans_begin(trans);
bch2_trans_iter_init(trans, &iter, BTREE_ID_alloc, bch2_trans_iter_init(trans, &iter, BTREE_ID_alloc,
bucket, BTREE_ITER_CACHED); bucket, BTREE_ITER_CACHED);
ret = lockrestart_do(trans, ret = lockrestart_do(trans,
......
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