diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-19 14:13:17 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:58 -0400 |
commit | 3e36e572f14bfa2bac80c3ba07af67e204eb7820 (patch) | |
tree | fb245b00ec7aeefd83d2655186eb22092eefdcdf | |
parent | dc6274bcb87dbf50c62d9dbacba770bae2f10279 (diff) | |
download | linux-stable-3e36e572f14bfa2bac80c3ba07af67e204eb7820.tar.gz linux-stable-3e36e572f14bfa2bac80c3ba07af67e204eb7820.tar.bz2 linux-stable-3e36e572f14bfa2bac80c3ba07af67e204eb7820.zip |
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>
-rw-r--r-- | fs/bcachefs/move.c | 5 |
1 files changed, 5 insertions, 0 deletions
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, |