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>
This commit is contained in:
committed by
David S. Miller
parent
9ee6045f09
commit
cf778b00e9
@@ -205,7 +205,7 @@ static inline struct tnode *node_parent_rcu(const struct rt_trie_node *node)
|
||||
return (struct tnode *)(parent & ~NODE_TYPE_MASK);
|
||||
}
|
||||
|
||||
/* Same as RCU_INIT_POINTER
|
||||
/* Same as rcu_assign_pointer
|
||||
* but that macro() assumes that value is a pointer.
|
||||
*/
|
||||
static 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 *
|
||||
if (n)
|
||||
node_set_parent(n, tn);
|
||||
|
||||
RCU_INIT_POINTER(tn->child[i], n);
|
||||
rcu_assign_pointer(tn->child[i], n);
|
||||
}
|
||||
|
||||
#define MAX_WORK 10
|
||||
@@ -1015,7 +1015,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
|
||||
|
||||
tp = node_parent((struct rt_trie_node *) tn);
|
||||
if (!tp)
|
||||
RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
|
||||
rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
|
||||
|
||||
tnode_free_flush();
|
||||
if (!tp)
|
||||
@@ -1027,7 +1027,7 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
|
||||
if (IS_TNODE(tn))
|
||||
tn = (struct tnode *)resize(t, (struct tnode *)tn);
|
||||
|
||||
RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
|
||||
rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
|
||||
tnode_free_flush();
|
||||
}
|
||||
|
||||
@@ -1164,7 +1164,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)
|
||||
put_child(t, (struct tnode *)tp, cindex,
|
||||
(struct rt_trie_node *)tn);
|
||||
} else {
|
||||
RCU_INIT_POINTER(t->trie, (struct rt_trie_node *)tn);
|
||||
rcu_assign_pointer(t->trie, (struct rt_trie_node *)tn);
|
||||
tp = tn;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user