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 /net/ipv4/igmp.c | |
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>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 8 |
1 files changed, 4 insertions, 4 deletions
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: |