Subject: Re: [PATCH] inetpeer: fix a race in inetpeer_gc_worker()

From: Steffen Klassert <[email-masked]>
Date: Tue, 5 Jun 2012 15:01:42 +0200

On Tue, Jun 05, 2012 at 02:56:06PM +0200, Eric Dumazet wrote:
> On Tue, 2012-06-05 at 14:42 +0200, Steffen Klassert wrote:
> > 
> > Hm, I agree that we need rcu protection when we remove single entries
> > from an inetpeer tree. But in this case we invalidate the entire tree.
> > 
> > The first lookup after inetpeer_invalidate_tree() was invoked should
> > find an empty tree, base->root initialized to peer_avl_empty_rcu.
> > 
> > Maybe I'm wrong, but I don't see how a lookup should find such an
> > old invalidated tree.
> > 
> 
> You are absolutely wrong yes.
> 
> A concurrent lookup can read previous values of the root pointer, even
> if you wrote a new value in it. Thats whole RCU point.

Argh, yes. You are absolutely right of course, now I got it :)
Thanks for your explaination.