summaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
authorJosh Triplett2013-09-02 01:42:52 +0200
committerPaul E. McKenney2013-12-12 21:19:22 +0100
commit9d162cd06349dfee6b4f254b3abf1355cf0aee43 (patch)
tree307513abf19d6dffb78929c1c60f4a68f59d903a /include/linux/rcupdate.h
parentbonding: Use RCU_INIT_POINTER() for better overhead and for sparse (diff)
downloadkernel-qcow2-linux-9d162cd06349dfee6b4f254b3abf1355cf0aee43.tar.gz
kernel-qcow2-linux-9d162cd06349dfee6b4f254b3abf1355cf0aee43.tar.xz
kernel-qcow2-linux-9d162cd06349dfee6b4f254b3abf1355cf0aee43.zip
rcu: Make rcu_assign_pointer's assignment volatile and type-safe
The rcu_assign_pointer() primitive needs to use ACCESS_ONCE to make the assignment to the destination pointer volatile, to protect against compilers too clever for their own good. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 00ad28168ef0..97853cd2d7b4 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -551,7 +551,7 @@ static inline void rcu_preempt_sleep_check(void)
#define __rcu_assign_pointer(p, v, space) \
do { \
smp_wmb(); \
- (p) = (typeof(*v) __force space *)(v); \
+ ACCESS_ONCE(p) = (typeof(*(v)) __force space *)(v); \
} while (0)