From: Kent Overstreet Date: Sun, 19 Mar 2023 18:13:17 +0000 (-0400) Subject: bcachefs: Fix an unhandled transaction restart error X-Git-Tag: io_uring-6.7-2023-11-10~119^2~402 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3e36e572f14bfa2bac80c3ba07af67e204eb7820;p=linux-block.git 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 --- diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c index 4a9ffca7be62..d94cefec9880 100644 --- a/fs/bcachefs/move.c +++ b/fs/bcachefs/move.c @@ -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,