summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-10 05:23:08 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 23:29:19 +0200
commitca563dccb2f0fb9b77971dcbead37b7e5f75723d (patch)
treedd4d9122e0130ade6773216328de3cb06ffa10fa /fs/bcachefs/alloc_foreground.c
parentbcachefs: Use bch2_btree_path_upgrade() in key cache traverse (diff)
downloadlinux-ca563dccb2f0fb9b77971dcbead37b7e5f75723d.tar.xz
linux-ca563dccb2f0fb9b77971dcbead37b7e5f75723d.zip
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_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index df4439a38df5..fb8825c4e7ad 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -1342,6 +1342,10 @@ retry:
*wp_ret = wp = writepoint_find(trans, write_point.v);
+ ret = bch2_trans_relock(trans);
+ if (ret)
+ goto err;
+
/* metadata may not allocate on cache devices: */
if (wp->data_type != BCH_DATA_user)
have_cache = true;