aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_trie.c
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/ipv4/fib_trie.c
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/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index d04b13ae18f..2b555a5521e 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 */
211static inline void node_set_parent(struct rt_trie_node *node, struct tnode *ptr) 211static 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 }