From 3e36e572f14bfa2bac80c3ba07af67e204eb7820 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 19 Mar 2023 14:13:17 -0400 Subject: [PATCH] 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 --- fs/bcachefs/move.c | 5 +++++ 1 file changed, 5 insertions(+) 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,