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/netfilter | |
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/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_ecache.c | 4 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_extend.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_helper.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_log.c | 6 | ||||
-rw-r--r-- | net/netfilter/nf_queue.c | 2 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 4 |
8 files changed, 12 insertions, 12 deletions
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 | ||