summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-09 23:23:08 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-04-13 14:33:16 -0400
commitccc616d37af0c7c44df471100e7d390c9acb7ab6 (patch)
treef160ca59517867edea70b6d0670b2309e8cc3517 /fs/bcachefs/alloc_background.c
parent4fe04b28259bab169314ed17d2f46af6c1079838 (diff)
bcachefs: bch2_trans_unlock() must always be followed by relock() or begin()
We're about to add new asserts for btree_trans locking consistency, and part of that requires that aren't using the btree_trans while it's unlocked. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.c')
-rw-r--r--fs/bcachefs/alloc_background.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 86c0f988d51b..c2d44d763ce4 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -2172,6 +2172,9 @@ int bch2_bucket_io_time_reset(struct btree_trans *trans, unsigned dev,
u64 now;
int ret = 0;
+ if (bch2_trans_relock(trans))
+ bch2_trans_begin(trans);
+
a = bch2_trans_start_alloc_update(trans, &iter, POS(dev, bucket_nr));
ret = PTR_ERR_OR_ZERO(a);
if (ret)