summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/alloc.h')
-rw-r--r--libbcachefs/alloc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libbcachefs/alloc.h b/libbcachefs/alloc.h
index 372cc047..00d01f46 100644
--- a/libbcachefs/alloc.h
+++ b/libbcachefs/alloc.h
@@ -103,7 +103,8 @@ static inline void bch2_wake_allocator(struct bch_dev *ca)
struct task_struct *p;
rcu_read_lock();
- if ((p = READ_ONCE(ca->alloc_thread)))
+ p = rcu_dereference(ca->alloc_thread);
+ if (p)
wake_up_process(p);
rcu_read_unlock();
}