summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-10 22:13:01 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-06-10 22:15:00 -0400
commit17d1c4f4fe29453fbb4087eb5de8aa6f9e6605c7 (patch)
tree84a0fb52242d7890ff6b2eb8c449b696f2edd844 /libbcachefs/alloc_foreground.c
parent7a66cf70c5d8b02f84595e5648c12e7422e4d03e (diff)
Update bcachefs sources to ed6b7f81a7 six locks: Disable percpu read lock mode in userspace
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/alloc_foreground.c')
-rw-r--r--libbcachefs/alloc_foreground.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libbcachefs/alloc_foreground.c b/libbcachefs/alloc_foreground.c
index ec77601e..95829bbf 100644
--- a/libbcachefs/alloc_foreground.c
+++ b/libbcachefs/alloc_foreground.c
@@ -371,7 +371,8 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc
if (!ob)
iter.path->preserve = false;
err:
- set_btree_iter_dontneed(&iter);
+ if (iter.trans && iter.path)
+ set_btree_iter_dontneed(&iter);
bch2_trans_iter_exit(trans, &iter);
printbuf_exit(&buf);
return ob;
@@ -934,9 +935,7 @@ static int __open_bucket_add_buckets(struct btree_trans *trans,
unsigned i;
int ret;
- rcu_read_lock();
devs = target_rw_devs(c, wp->data_type, target);
- rcu_read_unlock();
/* Don't allocate from devices we already have pointers to: */
for (i = 0; i < devs_have->nr; i++)