Skip to content

Commit

Permalink
ipv4: Fix fib_trie rebalancing, part 3
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Jun 30, 2009
1 parent 01e5329 commit 008440e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 008440e

Please sign in to comment.