[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120605130142.GF27795@secunet.com>
Date: Tue, 5 Jun 2012 15:01:42 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] inetpeer: fix a race in inetpeer_gc_worker()
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists