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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-03-19 14:13:17 -04:00
parent dc6274bcb8
commit 3e36e572f1

View File

@ -713,6 +713,11 @@ int __bch2_evacuate_bucket(struct btree_trans *trans,
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,
bucket, BTREE_ITER_CACHED);
ret = lockrestart_do(trans,