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/netlabel/netlabel_unlabeled.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/netlabel/netlabel_unlabeled.c')
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 6 |
1 files changed, 2 insertions, 4 deletions
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 | ||