summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/alloc.h')
-rw-r--r--fs/bcachefs/alloc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc.h b/fs/bcachefs/alloc.h
index 372cc047e927..00d01f464c68 100644
--- a/fs/bcachefs/alloc.h
+++ b/fs/bcachefs/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();
}