diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2012-01-11 23:41:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-01-12 15:26:56 -0500 |
commit | cf778b00e96df6d64f8e21b8395d1f8a859ecdc7 (patch) | |
tree | 4cc157d564bd65d687bdf722af3202e9e277ea98 | |
parent | 9ee6045f09a7875ebe55b9942b232a19076b157b (diff) |
net: reintroduce missing rcu_assign_pointer() calls
commit a9b3cd7f32 (rcu: convert uses of rcu_assign_pointer(x, NULL) to
RCU_INIT_POINTER) did a lot of incorrect changes, since it did a
complete conversion of rcu_assign_pointer(x, y) to RCU_INIT_POINTER(x,
y).
We miss needed barriers, even on x86, when y is not NULL.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
32 files changed, 61 insertions, 63 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index abf4393a77b3..f3dbd4f596a4 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -1177,9 +1177,9 @@ static ssize_t store_xps_map(struct netdev_queue *queue, | |||
1177 | nonempty = 1; | 1177 | nonempty = 1; |
1178 | } | 1178 | } |
1179 | 1179 | ||
1180 | if (nonempty) | 1180 | if (nonempty) { |
1181 | RCU_INIT_POINTER(dev->xps_maps, new_dev_maps); | 1181 | rcu_assign_pointer(dev->xps_maps, new_dev_maps); |
1182 | else { | 1182 | } else { |
1183 | kfree(new_dev_maps); | 1183 | kfree(new_dev_maps); |
1184 | RCU_INIT_POINTER(dev->xps_maps, NULL); | 1184 | RCU_INIT_POINTER(dev->xps_maps, NULL); |
1185 | } | 1185 | } |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 0d38808a2305..556b08298669 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -765,7 +765,7 @@ int __netpoll_setup(struct netpoll *np) | |||
765 | } | 765 | } |
766 | 766 | ||
767 | /* last thing to do is link it to the net device structure */ | 767 | /* last thing to do is link it to the net device structure */ |
768 | RCU_INIT_POINTER(ndev->npinfo, npinfo); | 768 | rcu_assign_pointer(ndev->npinfo, npinfo); |
769 | 769 | ||
770 | return 0; | 770 | return 0; |
771 | 771 | ||
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 2ab16e12520c..74d321a60e7b 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -388,7 +388,7 @@ static int dn_dev_insert_ifa(struct dn_dev *dn_db, struct dn_ifaddr *ifa) | |||
388 | } | 388 | } |
389 | 389 | ||
390 | ifa->ifa_next = dn_db->ifa_list; | 390 | ifa->ifa_next = dn_db->ifa_list; |
391 | RCU_INIT_POINTER(dn_db->ifa_list, ifa); | 391 | rcu_assign_pointer(dn_db->ifa_list, ifa); |
392 | 392 | ||
393 | dn_ifaddr_notify(RTM_NEWADDR, ifa); | 393 | dn_ifaddr_notify(RTM_NEWADDR, ifa); |
394 | blocking_notifier_call_chain(&dnaddr_chain, NETDEV_UP, ifa); | 394 | blocking_notifier_call_chain(&dnaddr_chain, NETDEV_UP, ifa); |
@@ -1093,7 +1093,7 @@ static struct dn_dev *dn_dev_create(struct net_device *dev, int *err) | |||
1093 | 1093 | ||
1094 | memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms)); | 1094 | memcpy(&dn_db->parms, p, sizeof(struct dn_dev_parms)); |
1095 | 1095 | ||
1096 | RCU_INIT_POINTER(dev->dn_ptr, dn_db); | 1096 | rcu_assign_pointer(dev->dn_ptr, dn_db); |
1097 | dn_db->dev = dev; | 1097 | dn_db->dev = dev; |
1098 | init_timer(&dn_db->timer); | 1098 | init_timer(&dn_db->timer); |
1099 | 1099 | ||
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 65f01dc47565..e41c40f48cfe 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -258,7 +258,7 @@ static struct in_device *inetdev_init(struct net_device *dev) | |||
258 | ip_mc_up(in_dev); | 258 | ip_mc_up(in_dev); |
259 | 259 | ||
260 | /* we can receive as soon as ip_ptr is set -- do this last */ | 260 | /* we can receive as soon as ip_ptr is set -- do this last */ |
261 | RCU_INIT_POINTER(dev->ip_ptr, in_dev); | 261 | rcu_assign_pointer(dev->ip_ptr, in_dev); |
262 | out: | 262 | out: |
263 | return in_dev; | 263 | return in_dev; |
264 | out_kfree: | 264 | out_kfree: |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index d04b13ae18fe..2b555a5521e0 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -205,7 +205,7 @@ static inline struct tnode *node_parent_rcu(const struct rt_trie_node *node) | |||
205 | return (struct tnode *)(parent & ~NODE_TYPE_MASK); | 205 | return (struct tnode *)(parent & ~NODE_TYPE_MASK); |
206 | } | 206 | } |
207 | 207 | ||
208 | /* Same as RCU_INIT_POINTER | 208 | /* Same as rcu_assign_pointer |
209 | * but that macro() assumes that value is a pointer. | 209 | * but that macro() assumes that value is a pointer. |
210 | */ | 210 | */ |
211 | static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr) | 211 | static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr) |
@@ -529,7 +529,7 @@ static void tnode_put_child_reorg(struct tnode *tn, int i, struct rt_trie_node * | |||
529 | if (n) | 529 | if (n) |
530 | node_set_parent(n, tn); | 530 | node_set_parent(n, tn); |
531 | 531 | ||
532 | RCU_INIT_POINTER(tn->child[i], n); | 532 | rcu_assign_pointer(tn->child[i], n); |
533 | } | 533 | } |
534 | 534 | ||
535 | #define MAX_WORK 10 | 535 | #define MAX_WORK 10 |
@@ -1015,7 +1015,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn) | |||
1015 | 1015 | ||
1016 | tp = node_parent((struct rt_trie_node *) tn); | 1016 | tp = node_parent((struct rt_trie_node *) tn); |
1017 | if (!tp) | 1017 | if (!tp) |
1018 | RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn); | 1018 | rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn); |
1019 | 1019 | ||
1020 | tnode_free_flush(); | 1020 | tnode_free_flush(); |
1021 | if (!tp) | 1021 | if (!tp) |
@@ -1027,7 +1027,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn) | |||
1027 | if (IS_TNODE(tn)) | 1027 | if (IS_TNODE(tn)) |
1028 | tn = (struct tnode *)resize(t, (struct tnode *)tn); | 1028 | tn = (struct tnode *)resize(t, (struct tnode *)tn); |
1029 | 1029 | ||
1030 | RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn); | 1030 | rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn); |
1031 | tnode_free_flush(); | 1031 | tnode_free_flush(); |
1032 | } | 1032 | } |
1033 | 1033 | ||
@@ -1164,7 +1164,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen) | |||
1164 | put_child(t, (struct tnode *)tp, cindex, | 1164 | put_child(t, (struct tnode *)tp, cindex, |
1165 | (struct rt_trie_node *)tn); | 1165 | (struct rt_trie_node *)tn); |
1166 | } else { | 1166 | } else { |
1167 | RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn); | 1167 | rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn); |
1168 | tp = tn; | 1168 | tp = tn; |
1169 | } | 1169 | } |
1170 | } | 1170 | } |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 5104bc0bbdbe..450e5d21ed2a 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1249,7 +1249,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) | |||
1249 | 1249 | ||
1250 | im->next_rcu = in_dev->mc_list; | 1250 | im->next_rcu = in_dev->mc_list; |
1251 | in_dev->mc_count++; | 1251 | in_dev->mc_count++; |
1252 | RCU_INIT_POINTER(in_dev->mc_list, im); | 1252 | rcu_assign_pointer(in_dev->mc_list, im); |
1253 | 1253 | ||
1254 | #ifdef CONFIG_IP_MULTICAST | 1254 | #ifdef CONFIG_IP_MULTICAST |
1255 | igmpv3_del_delrec(in_dev, im->multiaddr); | 1255 | igmpv3_del_delrec(in_dev, im->multiaddr); |
@@ -1821,7 +1821,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr) | |||
1821 | iml->next_rcu = inet->mc_list; | 1821 | iml->next_rcu = inet->mc_list; |
1822 | iml->sflist = NULL; | 1822 | iml->sflist = NULL; |
1823 | iml->sfmode = MCAST_EXCLUDE; | 1823 | iml->sfmode = MCAST_EXCLUDE; |
1824 | RCU_INIT_POINTER(inet->mc_list, iml); | 1824 | rcu_assign_pointer(inet->mc_list, iml); |
1825 | ip_mc_inc_group(in_dev, addr); | 1825 | ip_mc_inc_group(in_dev, addr); |
1826 | err = 0; | 1826 | err = 0; |
1827 | done: | 1827 | done: |
@@ -2008,7 +2008,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct | |||
2008 | atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); | 2008 | atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); |
2009 | kfree_rcu(psl, rcu); | 2009 | kfree_rcu(psl, rcu); |
2010 | } | 2010 | } |
2011 | RCU_INIT_POINTER(pmc->sflist, newpsl); | 2011 | rcu_assign_pointer(pmc->sflist, newpsl); |
2012 | psl = newpsl; | 2012 | psl = newpsl; |
2013 | } | 2013 | } |
2014 | rv = 1; /* > 0 for insert logic below if sl_count is 0 */ | 2014 | rv = 1; /* > 0 for insert logic below if sl_count is 0 */ |
@@ -2111,7 +2111,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) | |||
2111 | } else | 2111 | } else |
2112 | (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, | 2112 | (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, |
2113 | 0, NULL, 0); | 2113 | 0, NULL, 0); |
2114 | RCU_INIT_POINTER(pmc->sflist, newpsl); | 2114 | rcu_assign_pointer(pmc->sflist, newpsl); |
2115 | pmc->sfmode = msf->imsf_fmode; | 2115 | pmc->sfmode = msf->imsf_fmode; |
2116 | err = 0; | 2116 | err = 0; |
2117 | done: | 2117 | done: |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 413ed1ba7a5a..22a199315309 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -231,7 +231,7 @@ static void ipip_tunnel_unlink(struct ipip_net *ipn, struct ip_tunnel *t) | |||
231 | (iter = rtnl_dereference(*tp)) != NULL; | 231 | (iter = rtnl_dereference(*tp)) != NULL; |
232 | tp = &iter->next) { | 232 | tp = &iter->next) { |
233 | if (t == iter) { | 233 | if (t == iter) { |
234 | RCU_INIT_POINTER(*tp, t->next); | 234 | rcu_assign_pointer(*tp, t->next); |
235 | break; | 235 | break; |
236 | } | 236 | } |
237 | } | 237 | } |
@@ -241,8 +241,8 @@ static void ipip_tunnel_link(struct ipip_net *ipn, struct ip_tunnel *t) | |||
241 | { | 241 | { |
242 | struct ip_tunnel __rcu **tp = ipip_bucket(ipn, t); | 242 | struct ip_tunnel __rcu **tp = ipip_bucket(ipn, t); |
243 | 243 | ||
244 | RCU_INIT_POINTER(t->next, rtnl_dereference(*tp)); | 244 | rcu_assign_pointer(t->next, rtnl_dereference(*tp)); |
245 | RCU_INIT_POINTER(*tp, t); | 245 | rcu_assign_pointer(*tp, t); |
246 | } | 246 | } |
247 | 247 | ||
248 | static struct ip_tunnel * ipip_tunnel_locate(struct net *net, | 248 | static struct ip_tunnel * ipip_tunnel_locate(struct net *net, |
@@ -792,7 +792,7 @@ static int __net_init ipip_fb_tunnel_init(struct net_device *dev) | |||
792 | return -ENOMEM; | 792 | return -ENOMEM; |
793 | 793 | ||
794 | dev_hold(dev); | 794 | dev_hold(dev); |
795 | RCU_INIT_POINTER(ipn->tunnels_wc[0], tunnel); | 795 | rcu_assign_pointer(ipn->tunnels_wc[0], tunnel); |
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | 798 | ||
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 8e54490ee3f4..7bc2db6db8d4 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1225,7 +1225,7 @@ int ip_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsi | |||
1225 | 1225 | ||
1226 | ret = ip_ra_control(sk, 1, mrtsock_destruct); | 1226 | ret = ip_ra_control(sk, 1, mrtsock_destruct); |
1227 | if (ret == 0) { | 1227 | if (ret == 0) { |
1228 | RCU_INIT_POINTER(mrt->mroute_sk, sk); | 1228 | rcu_assign_pointer(mrt->mroute_sk, sk); |
1229 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; | 1229 | IPV4_DEVCONF_ALL(net, MC_FORWARDING)++; |
1230 | } | 1230 | } |
1231 | rtnl_unlock(); | 1231 | rtnl_unlock(); |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 0ba0866230c9..a225d5ee3c2f 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -429,7 +429,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) | |||
429 | ndev->tstamp = jiffies; | 429 | ndev->tstamp = jiffies; |
430 | addrconf_sysctl_register(ndev); | 430 | addrconf_sysctl_register(ndev); |
431 | /* protected by rtnl_lock */ | 431 | /* protected by rtnl_lock */ |
432 | RCU_INIT_POINTER(dev->ip6_ptr, ndev); | 432 | rcu_assign_pointer(dev->ip6_ptr, ndev); |
433 | 433 | ||
434 | /* Join all-node multicast group */ | 434 | /* Join all-node multicast group */ |
435 | ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes); | 435 | ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes); |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index e1f7761815f3..aa21da6a09cd 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -218,8 +218,8 @@ ip6_tnl_link(struct ip6_tnl_net *ip6n, struct ip6_tnl *t) | |||
218 | { | 218 | { |
219 | struct ip6_tnl __rcu **tp = ip6_tnl_bucket(ip6n, &t->parms); | 219 | struct ip6_tnl __rcu **tp = ip6_tnl_bucket(ip6n, &t->parms); |
220 | 220 | ||
221 | RCU_INIT_POINTER(t->next , rtnl_dereference(*tp)); | 221 | rcu_assign_pointer(t->next , rtnl_dereference(*tp)); |
222 | RCU_INIT_POINTER(*tp, t); | 222 | rcu_assign_pointer(*tp, t); |
223 | } | 223 | } |
224 | 224 | ||
225 | /** | 225 | /** |
@@ -237,7 +237,7 @@ ip6_tnl_unlink(struct ip6_tnl_net *ip6n, struct ip6_tnl *t) | |||
237 | (iter = rtnl_dereference(*tp)) != NULL; | 237 | (iter = rtnl_dereference(*tp)) != NULL; |
238 | tp = &iter->next) { | 238 | tp = &iter->next) { |
239 | if (t == iter) { | 239 | if (t == iter) { |
240 | RCU_INIT_POINTER(*tp, t->next); | 240 | rcu_assign_pointer(*tp, t->next); |
241 | break; | 241 | break; |
242 | } | 242 | } |
243 | } | 243 | } |
@@ -1450,7 +1450,7 @@ static int __net_init ip6_fb_tnl_dev_init(struct net_device *dev) | |||
1450 | 1450 | ||
1451 | t->parms.proto = IPPROTO_IPV6; | 1451 | t->parms.proto = IPPROTO_IPV6; |
1452 | dev_hold(dev); | 1452 | dev_hold(dev); |
1453 | RCU_INIT_POINTER(ip6n->tnls_wc[0], t); | 1453 | rcu_assign_pointer(ip6n->tnls_wc[0], t); |
1454 | return 0; | 1454 | return 0; |
1455 | } | 1455 | } |
1456 | 1456 | ||
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index a4894f4f1944..d02f7e4dd611 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -131,7 +131,7 @@ static mh_filter_t __rcu *mh_filter __read_mostly; | |||
131 | 131 | ||
132 | int rawv6_mh_filter_register(mh_filter_t filter) | 132 | int rawv6_mh_filter_register(mh_filter_t filter) |
133 | { | 133 | { |
134 | RCU_INIT_POINTER(mh_filter, filter); | 134 | rcu_assign_pointer(mh_filter, filter); |
135 | return 0; | 135 | return 0; |
136 | } | 136 | } |
137 | EXPORT_SYMBOL(rawv6_mh_filter_register); | 137 | EXPORT_SYMBOL(rawv6_mh_filter_register); |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 3b6dac956bb0..133768e52912 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -182,7 +182,7 @@ static void ipip6_tunnel_unlink(struct sit_net *sitn, struct ip_tunnel *t) | |||
182 | (iter = rtnl_dereference(*tp)) != NULL; | 182 | (iter = rtnl_dereference(*tp)) != NULL; |
183 | tp = &iter->next) { | 183 | tp = &iter->next) { |
184 | if (t == iter) { | 184 | if (t == iter) { |
185 | RCU_INIT_POINTER(*tp, t->next); | 185 | rcu_assign_pointer(*tp, t->next); |
186 | break; | 186 | break; |
187 | } | 187 | } |
188 | } | 188 | } |
@@ -192,8 +192,8 @@ static void ipip6_tunnel_link(struct sit_net *sitn, struct ip_tunnel *t) | |||
192 | { | 192 | { |
193 | struct ip_tunnel __rcu **tp = ipip6_bucket(sitn, t); | 193 | struct ip_tunnel __rcu **tp = ipip6_bucket(sitn, t); |
194 | 194 | ||
195 | RCU_INIT_POINTER(t->next, rtnl_dereference(*tp)); | 195 | rcu_assign_pointer(t->next, rtnl_dereference(*tp)); |
196 | RCU_INIT_POINTER(*tp, t); | 196 | rcu_assign_pointer(*tp, t); |
197 | } | 197 | } |
198 | 198 | ||
199 | static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn) | 199 | static void ipip6_tunnel_clone_6rd(struct net_device *dev, struct sit_net *sitn) |
@@ -393,7 +393,7 @@ ipip6_tunnel_add_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a, int chg) | |||
393 | p->addr = a->addr; | 393 | p->addr = a->addr; |
394 | p->flags = a->flags; | 394 | p->flags = a->flags; |
395 | t->prl_count++; | 395 | t->prl_count++; |
396 | RCU_INIT_POINTER(t->prl, p); | 396 | rcu_assign_pointer(t->prl, p); |
397 | out: | 397 | out: |
398 | return err; | 398 | return err; |
399 | } | 399 | } |
@@ -1177,7 +1177,7 @@ static int __net_init ipip6_fb_tunnel_init(struct net_device *dev) | |||
1177 | if (!dev->tstats) | 1177 | if (!dev->tstats) |
1178 | return -ENOMEM; | 1178 | return -ENOMEM; |
1179 | dev_hold(dev); | 1179 | dev_hold(dev); |
1180 | RCU_INIT_POINTER(sitn->tunnels_wc[0], tunnel); | 1180 | rcu_assign_pointer(sitn->tunnels_wc[0], tunnel); |
1181 | return 0; | 1181 | return 0; |
1182 | } | 1182 | } |
1183 | 1183 | ||
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 96debba2c407..1068f668ac4e 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c | |||
@@ -332,7 +332,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local, | |||
332 | status = WLAN_STATUS_SUCCESS; | 332 | status = WLAN_STATUS_SUCCESS; |
333 | 333 | ||
334 | /* activate it for RX */ | 334 | /* activate it for RX */ |
335 | RCU_INIT_POINTER(sta->ampdu_mlme.tid_rx[tid], tid_agg_rx); | 335 | rcu_assign_pointer(sta->ampdu_mlme.tid_rx[tid], tid_agg_rx); |
336 | 336 | ||
337 | if (timeout) | 337 | if (timeout) |
338 | mod_timer(&tid_agg_rx->session_timer, TU_TO_EXP_TIME(timeout)); | 338 | mod_timer(&tid_agg_rx->session_timer, TU_TO_EXP_TIME(timeout)); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 850bb96bd680..e60df48fa4d4 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -616,7 +616,7 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata, | |||
616 | 616 | ||
617 | sdata->vif.bss_conf.dtim_period = new->dtim_period; | 617 | sdata->vif.bss_conf.dtim_period = new->dtim_period; |
618 | 618 | ||
619 | RCU_INIT_POINTER(sdata->u.ap.beacon, new); | 619 | rcu_assign_pointer(sdata->u.ap.beacon, new); |
620 | 620 | ||
621 | synchronize_rcu(); | 621 | synchronize_rcu(); |
622 | 622 | ||
@@ -1033,7 +1033,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
1033 | return -EBUSY; | 1033 | return -EBUSY; |
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | RCU_INIT_POINTER(vlansdata->u.vlan.sta, sta); | 1036 | rcu_assign_pointer(vlansdata->u.vlan.sta, sta); |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | sta->sdata = vlansdata; | 1039 | sta->sdata = vlansdata; |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index f8a32bf98216..b3d76b756cd5 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -207,7 +207,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
207 | *pos++ = 0; /* U-APSD no in use */ | 207 | *pos++ = 0; /* U-APSD no in use */ |
208 | } | 208 | } |
209 | 209 | ||
210 | RCU_INIT_POINTER(ifibss->presp, skb); | 210 | rcu_assign_pointer(ifibss->presp, skb); |
211 | 211 | ||
212 | sdata->vif.bss_conf.beacon_int = beacon_int; | 212 | sdata->vif.bss_conf.beacon_int = beacon_int; |
213 | sdata->vif.bss_conf.basic_rates = basic_rates; | 213 | sdata->vif.bss_conf.basic_rates = basic_rates; |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index b197136aea2c..3c428d4839c7 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -73,7 +73,7 @@ static int sta_info_hash_del(struct ieee80211_local *local, | |||
73 | if (!s) | 73 | if (!s) |
74 | return -ENOENT; | 74 | return -ENOENT; |
75 | if (s == sta) { | 75 | if (s == sta) { |
76 | RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], | 76 | rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], |
77 | s->hnext); | 77 | s->hnext); |
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
@@ -83,7 +83,7 @@ static int sta_info_hash_del(struct ieee80211_local *local, | |||
83 | s = rcu_dereference_protected(s->hnext, | 83 | s = rcu_dereference_protected(s->hnext, |
84 | lockdep_is_held(&local->sta_mtx)); | 84 | lockdep_is_held(&local->sta_mtx)); |
85 | if (rcu_access_pointer(s->hnext)) { | 85 | if (rcu_access_pointer(s->hnext)) { |
86 | RCU_INIT_POINTER(s->hnext, sta->hnext); | 86 | rcu_assign_pointer(s->hnext, sta->hnext); |
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
@@ -226,7 +226,7 @@ static void sta_info_hash_add(struct ieee80211_local *local, | |||
226 | { | 226 | { |
227 | lockdep_assert_held(&local->sta_mtx); | 227 | lockdep_assert_held(&local->sta_mtx); |
228 | sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)]; | 228 | sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)]; |
229 | RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], sta); | 229 | rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta); |
230 | } | 230 | } |
231 | 231 | ||
232 | static void sta_unblock(struct work_struct *wk) | 232 | static void sta_unblock(struct work_struct *wk) |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index e875f8902db3..76613f5a55c0 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -777,7 +777,7 @@ init_conntrack(struct net *net, struct nf_conn *tmpl, | |||
777 | if (exp->helper) { | 777 | if (exp->helper) { |
778 | help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); | 778 | help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); |
779 | if (help) | 779 | if (help) |
780 | RCU_INIT_POINTER(help->helper, exp->helper); | 780 | rcu_assign_pointer(help->helper, exp->helper); |
781 | } | 781 | } |
782 | 782 | ||
783 | #ifdef CONFIG_NF_CONNTRACK_MARK | 783 | #ifdef CONFIG_NF_CONNTRACK_MARK |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index b62c4148b921..14af6329bdda 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
@@ -91,7 +91,7 @@ int nf_conntrack_register_notifier(struct net *net, | |||
91 | ret = -EBUSY; | 91 | ret = -EBUSY; |
92 | goto out_unlock; | 92 | goto out_unlock; |
93 | } | 93 | } |
94 | RCU_INIT_POINTER(net->ct.nf_conntrack_event_cb, new); | 94 | rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new); |
95 | mutex_unlock(&nf_ct_ecache_mutex); | 95 | mutex_unlock(&nf_ct_ecache_mutex); |
96 | return ret; | 96 | return ret; |
97 | 97 | ||
@@ -128,7 +128,7 @@ int nf_ct_expect_register_notifier(struct net *net, | |||
128 | ret = -EBUSY; | 128 | ret = -EBUSY; |
129 | goto out_unlock; | 129 | goto out_unlock; |
130 | } | 130 | } |
131 | RCU_INIT_POINTER(net->ct.nf_expect_event_cb, new); | 131 | rcu_assign_pointer(net->ct.nf_expect_event_cb, new); |
132 | mutex_unlock(&nf_ct_ecache_mutex); | 132 | mutex_unlock(&nf_ct_ecache_mutex); |
133 | return ret; | 133 | return ret; |
134 | 134 | ||
diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c index 4605c947dcc4..641ff5f96718 100644 --- a/net/netfilter/nf_conntrack_extend.c +++ b/net/netfilter/nf_conntrack_extend.c | |||
@@ -169,7 +169,7 @@ int nf_ct_extend_register(struct nf_ct_ext_type *type) | |||
169 | before updating alloc_size */ | 169 | before updating alloc_size */ |
170 | type->alloc_size = ALIGN(sizeof(struct nf_ct_ext), type->align) | 170 | type->alloc_size = ALIGN(sizeof(struct nf_ct_ext), type->align) |
171 | + type->len; | 171 | + type->len; |
172 | RCU_INIT_POINTER(nf_ct_ext_types[type->id], type); | 172 | rcu_assign_pointer(nf_ct_ext_types[type->id], type); |
173 | update_alloc_size(type); | 173 | update_alloc_size(type); |
174 | out: | 174 | out: |
175 | mutex_unlock(&nf_ct_ext_type_mutex); | 175 | mutex_unlock(&nf_ct_ext_type_mutex); |
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index c9e0de08aa87..299fec91f741 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c | |||
@@ -157,7 +157,7 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, | |||
157 | memset(&help->help, 0, sizeof(help->help)); | 157 | memset(&help->help, 0, sizeof(help->help)); |
158 | } | 158 | } |
159 | 159 | ||
160 | RCU_INIT_POINTER(help->helper, helper); | 160 | rcu_assign_pointer(help->helper, helper); |
161 | out: | 161 | out: |
162 | return ret; | 162 | return ret; |
163 | } | 163 | } |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index e07dc3ae930e..2a4834b83332 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1172,7 +1172,7 @@ ctnetlink_change_helper(struct nf_conn *ct, const struct nlattr * const cda[]) | |||
1172 | return -EOPNOTSUPP; | 1172 | return -EOPNOTSUPP; |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | RCU_INIT_POINTER(help->helper, helper); | 1175 | rcu_assign_pointer(help->helper, helper); |
1176 | 1176 | ||
1177 | return 0; | 1177 | return 0; |
1178 | } | 1178 | } |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index ce0c406f58a8..957374a234d4 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -55,7 +55,7 @@ int nf_log_register(u_int8_t pf, struct nf_logger *logger) | |||
55 | llog = rcu_dereference_protected(nf_loggers[pf], | 55 | llog = rcu_dereference_protected(nf_loggers[pf], |
56 | lockdep_is_held(&nf_log_mutex)); | 56 | lockdep_is_held(&nf_log_mutex)); |
57 | if (llog == NULL) | 57 | if (llog == NULL) |
58 | RCU_INIT_POINTER(nf_loggers[pf], logger); | 58 | rcu_assign_pointer(nf_loggers[pf], logger); |
59 | } | 59 | } |
60 | 60 | ||
61 | mutex_unlock(&nf_log_mutex); | 61 | mutex_unlock(&nf_log_mutex); |
@@ -92,7 +92,7 @@ int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger) | |||
92 | mutex_unlock(&nf_log_mutex); | 92 | mutex_unlock(&nf_log_mutex); |
93 | return -ENOENT; | 93 | return -ENOENT; |
94 | } | 94 | } |
95 | RCU_INIT_POINTER(nf_loggers[pf], logger); | 95 | rcu_assign_pointer(nf_loggers[pf], logger); |
96 | mutex_unlock(&nf_log_mutex); | 96 | mutex_unlock(&nf_log_mutex); |
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
@@ -250,7 +250,7 @@ static int nf_log_proc_dostring(ctl_table *table, int write, | |||
250 | mutex_unlock(&nf_log_mutex); | 250 | mutex_unlock(&nf_log_mutex); |
251 | return -ENOENT; | 251 | return -ENOENT; |
252 | } | 252 | } |
253 | RCU_INIT_POINTER(nf_loggers[tindex], logger); | 253 | rcu_assign_pointer(nf_loggers[tindex], logger); |
254 | mutex_unlock(&nf_log_mutex); | 254 | mutex_unlock(&nf_log_mutex); |
255 | } else { | 255 | } else { |
256 | mutex_lock(&nf_log_mutex); | 256 | mutex_lock(&nf_log_mutex); |
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c index 99ffd2885088..b3a7db678b8d 100644 --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c | |||
@@ -40,7 +40,7 @@ int nf_register_queue_handler(u_int8_t pf, const struct nf_queue_handler *qh) | |||
40 | else if (old) | 40 | else if (old) |
41 | ret = -EBUSY; | 41 | ret = -EBUSY; |
42 | else { | 42 | else { |
43 | RCU_INIT_POINTER(queue_handler[pf], qh); | 43 | rcu_assign_pointer(queue_handler[pf], qh); |
44 | ret = 0; | 44 | ret = 0; |
45 | } | 45 | } |
46 | mutex_unlock(&queue_handler_mutex); | 46 | mutex_unlock(&queue_handler_mutex); |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index c879c1a2370e..b4f8d849480c 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -59,7 +59,7 @@ int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n) | |||
59 | nfnl_unlock(); | 59 | nfnl_unlock(); |
60 | return -EBUSY; | 60 | return -EBUSY; |
61 | } | 61 | } |
62 | RCU_INIT_POINTER(subsys_table[n->subsys_id], n); | 62 | rcu_assign_pointer(subsys_table[n->subsys_id], n); |
63 | nfnl_unlock(); | 63 | nfnl_unlock(); |
64 | 64 | ||
65 | return 0; | 65 | return 0; |
@@ -210,7 +210,7 @@ static int __net_init nfnetlink_net_init(struct net *net) | |||
210 | if (!nfnl) | 210 | if (!nfnl) |
211 | return -ENOMEM; | 211 | return -ENOMEM; |
212 | net->nfnl_stash = nfnl; | 212 | net->nfnl_stash = nfnl; |
213 | RCU_INIT_POINTER(net->nfnl, nfnl); | 213 | rcu_assign_pointer(net->nfnl, nfnl); |
214 | return 0; | 214 | return 0; |
215 | } | 215 | } |
216 | 216 | ||
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index 38204112b9f4..d8d424337550 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c | |||
@@ -282,7 +282,7 @@ int __init netlbl_domhsh_init(u32 size) | |||
282 | INIT_LIST_HEAD(&hsh_tbl->tbl[iter]); | 282 | INIT_LIST_HEAD(&hsh_tbl->tbl[iter]); |
283 | 283 | ||
284 | spin_lock(&netlbl_domhsh_lock); | 284 | spin_lock(&netlbl_domhsh_lock); |
285 | RCU_INIT_POINTER(netlbl_domhsh, hsh_tbl); | 285 | rcu_assign_pointer(netlbl_domhsh, hsh_tbl); |
286 | spin_unlock(&netlbl_domhsh_lock); | 286 | spin_unlock(&netlbl_domhsh_lock); |
287 | 287 | ||
288 | return 0; | 288 | return 0; |
@@ -330,7 +330,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
330 | &rcu_dereference(netlbl_domhsh)->tbl[bkt]); | 330 | &rcu_dereference(netlbl_domhsh)->tbl[bkt]); |
331 | } else { | 331 | } else { |
332 | INIT_LIST_HEAD(&entry->list); | 332 | INIT_LIST_HEAD(&entry->list); |
333 | RCU_INIT_POINTER(netlbl_domhsh_def, entry); | 333 | rcu_assign_pointer(netlbl_domhsh_def, entry); |
334 | } | 334 | } |
335 | 335 | ||
336 | if (entry->type == NETLBL_NLTYPE_ADDRSELECT) { | 336 | if (entry->type == NETLBL_NLTYPE_ADDRSELECT) { |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 4b5fa0fe78fd..e7ff694f1049 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -354,7 +354,7 @@ static struct netlbl_unlhsh_iface *netlbl_unlhsh_add_iface(int ifindex) | |||
354 | INIT_LIST_HEAD(&iface->list); | 354 | INIT_LIST_HEAD(&iface->list); |
355 | if (netlbl_unlhsh_rcu_deref(netlbl_unlhsh_def) != NULL) | 355 | if (netlbl_unlhsh_rcu_deref(netlbl_unlhsh_def) != NULL) |
356 | goto add_iface_failure; | 356 | goto add_iface_failure; |
357 | RCU_INIT_POINTER(netlbl_unlhsh_def, iface); | 357 | rcu_assign_pointer(netlbl_unlhsh_def, iface); |
358 | } | 358 | } |
359 | spin_unlock(&netlbl_unlhsh_lock); | 359 | spin_unlock(&netlbl_unlhsh_lock); |
360 | 360 | ||
@@ -1447,11 +1447,9 @@ int __init netlbl_unlabel_init(u32 size) | |||
1447 | for (iter = 0; iter < hsh_tbl->size; iter++) | 1447 | for (iter = 0; iter < hsh_tbl->size; iter++) |
1448 | INIT_LIST_HEAD(&hsh_tbl->tbl[iter]); | 1448 | INIT_LIST_HEAD(&hsh_tbl->tbl[iter]); |
1449 | 1449 | ||
1450 | rcu_read_lock(); | ||
1451 | spin_lock(&netlbl_unlhsh_lock); | 1450 | spin_lock(&netlbl_unlhsh_lock); |
1452 | RCU_INIT_POINTER(netlbl_unlhsh, hsh_tbl); | 1451 | rcu_assign_pointer(netlbl_unlhsh, hsh_tbl); |
1453 | spin_unlock(&netlbl_unlhsh_lock); | 1452 | spin_unlock(&netlbl_unlhsh_lock); |
1454 | rcu_read_unlock(); | ||
1455 | 1453 | ||
1456 | register_netdevice_notifier(&netlbl_unlhsh_netdev_notifier); | 1454 | register_netdevice_notifier(&netlbl_unlhsh_netdev_notifier); |
1457 | 1455 | ||
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c index bf10ea8fbbf9..d65f699fbf34 100644 --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c | |||
@@ -480,7 +480,7 @@ int __init_or_module phonet_proto_register(unsigned int protocol, | |||
480 | if (proto_tab[protocol]) | 480 | if (proto_tab[protocol]) |
481 | err = -EBUSY; | 481 | err = -EBUSY; |
482 | else | 482 | else |
483 | RCU_INIT_POINTER(proto_tab[protocol], pp); | 483 | rcu_assign_pointer(proto_tab[protocol], pp); |
484 | mutex_unlock(&proto_tab_lock); | 484 | mutex_unlock(&proto_tab_lock); |
485 | 485 | ||
486 | return err; | 486 | return err; |
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index c5827614376b..9b9a85ecc4c7 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -390,7 +390,7 @@ int phonet_route_add(struct net_device *dev, u8 daddr) | |||
390 | daddr = daddr >> 2; | 390 | daddr = daddr >> 2; |
391 | mutex_lock(&routes->lock); | 391 | mutex_lock(&routes->lock); |
392 | if (routes->table[daddr] == NULL) { | 392 | if (routes->table[daddr] == NULL) { |
393 | RCU_INIT_POINTER(routes->table[daddr], dev); | 393 | rcu_assign_pointer(routes->table[daddr], dev); |
394 | dev_hold(dev); | 394 | dev_hold(dev); |
395 | err = 0; | 395 | err = 0; |
396 | } | 396 | } |
diff --git a/net/phonet/socket.c b/net/phonet/socket.c index 3f8d0b1603b9..4c7eff30dfa9 100644 --- a/net/phonet/socket.c +++ b/net/phonet/socket.c | |||
@@ -680,7 +680,7 @@ int pn_sock_bind_res(struct sock *sk, u8 res) | |||
680 | mutex_lock(&resource_mutex); | 680 | mutex_lock(&resource_mutex); |
681 | if (pnres.sk[res] == NULL) { | 681 | if (pnres.sk[res] == NULL) { |
682 | sock_hold(sk); | 682 | sock_hold(sk); |
683 | RCU_INIT_POINTER(pnres.sk[res], sk); | 683 | rcu_assign_pointer(pnres.sk[res], sk); |
684 | ret = 0; | 684 | ret = 0; |
685 | } | 685 | } |
686 | mutex_unlock(&resource_mutex); | 686 | mutex_unlock(&resource_mutex); |
diff --git a/net/socket.c b/net/socket.c index e56162cd65b0..28a96af484b4 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -2492,7 +2492,7 @@ int sock_register(const struct net_proto_family *ops) | |||
2492 | lockdep_is_held(&net_family_lock))) | 2492 | lockdep_is_held(&net_family_lock))) |
2493 | err = -EEXIST; | 2493 | err = -EEXIST; |
2494 | else { | 2494 | else { |
2495 | RCU_INIT_POINTER(net_families[ops->family], ops); | 2495 | rcu_assign_pointer(net_families[ops->family], ops); |
2496 | err = 0; | 2496 | err = 0; |
2497 | } | 2497 | } |
2498 | spin_unlock(&net_family_lock); | 2498 | spin_unlock(&net_family_lock); |
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index afb56553dfe7..db0efdec4e45 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -122,7 +122,7 @@ gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx) | |||
122 | if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) | 122 | if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) |
123 | return; | 123 | return; |
124 | gss_get_ctx(ctx); | 124 | gss_get_ctx(ctx); |
125 | RCU_INIT_POINTER(gss_cred->gc_ctx, ctx); | 125 | rcu_assign_pointer(gss_cred->gc_ctx, ctx); |
126 | set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); | 126 | set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); |
127 | smp_mb__before_clear_bit(); | 127 | smp_mb__before_clear_bit(); |
128 | clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); | 128 | clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e0d747a2e803..637f11a1e4df 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -2927,7 +2927,7 @@ static int __net_init xfrm_user_net_init(struct net *net) | |||
2927 | if (nlsk == NULL) | 2927 | if (nlsk == NULL) |
2928 | return -ENOMEM; | 2928 | return -ENOMEM; |
2929 | net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */ | 2929 | net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */ |
2930 | RCU_INIT_POINTER(net->xfrm.nlsk, nlsk); | 2930 | rcu_assign_pointer(net->xfrm.nlsk, nlsk); |
2931 | return 0; | 2931 | return 0; |
2932 | } | 2932 | } |
2933 | 2933 | ||