aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-01-11 23:41:32 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-12 15:26:56 -0500
commitcf778b00e96df6d64f8e21b8395d1f8a859ecdc7 (patch)
tree4cc157d564bd65d687bdf722af3202e9e277ea98 /net/netlabel
parent9ee6045f09a7875ebe55b9942b232a19076b157b (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/netlabel')
-rw-r--r--net/netlabel/netlabel_domainhash.c4
-rw-r--r--net/netlabel/netlabel_unlabeled.c6
2 files changed, 4 insertions, 6 deletions
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