1
0
Fork 0

ipv4: Fix fib_trie rebalancing, part 3

Alas current delaying of freeing old tnodes by RCU in trie_rebalance
is still not enough because we can free a top tnode before updating a
t->trie pointer.

Reported-by: Pawel Staszewski <pstaszewski@itcare.pl>
Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Jarek Poplawski 2009-06-30 12:47:19 -07:00 committed by David S. Miller
parent 01e5329814
commit 008440e3ad
1 changed files with 3 additions and 0 deletions

View File

@ -1021,6 +1021,9 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
(struct node *)tn, wasfull);
tp = node_parent((struct node *) tn);
if (!tp)
rcu_assign_pointer(t->trie, (struct node *)tn);
tnode_free_flush();
if (!tp)
break;