Commit 008440e3 authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller

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: default avatarPawel Staszewski <pstaszewski@itcare.pl>
Tested-by: default avatarPawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 01e53298
...@@ -1021,6 +1021,9 @@ static void trie_rebalance(struct trie *t, struct tnode *tn) ...@@ -1021,6 +1021,9 @@ static void trie_rebalance(struct trie *t, struct tnode *tn)
(struct node *)tn, wasfull); (struct node *)tn, wasfull);
tp = node_parent((struct node *) tn); tp = node_parent((struct node *) tn);
if (!tp)
rcu_assign_pointer(t->trie, (struct node *)tn);
tnode_free_flush(); tnode_free_flush();
if (!tp) if (!tp)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment