[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080109.063126.68241252.davem@davemloft.net>
Date: Wed, 09 Jan 2008 06:31:26 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: paulmck@...ux.vnet.ibm.com
Cc: dada1@...mosbay.com, herbert@...dor.apana.org.au,
dipankar@...ibm.com, netdev@...r.kernel.org
Subject: Re: [NET] ROUTE: fix rcu_dereference() uses in /proc/net/rt_cache
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Date: Wed, 9 Jan 2008 06:22:58 -0800
> On Wed, Jan 09, 2008 at 11:37:27AM +0100, Eric Dumazet wrote:
> > On Wed, 9 Jan 2008 20:46:37 +1100
> > Herbert Xu <herbert@...dor.apana.org.au> wrote:
> >
> > diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> > index d337706..28484f3 100644
> > --- a/net/ipv4/route.c
> > +++ b/net/ipv4/route.c
> > @@ -283,12 +283,12 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
> > break;
> > rcu_read_unlock_bh();
> > }
> > - return r;
> > + return rcu_dereference(r);
> > }
>
> Would it be possible to tag rt_cache_get_first() with an __acquires(RCU)
> to help out sparse?
Sparse can't handle conditional locking very well, as is done here.
There is a seperate thread where Eric reworks how all of this
locking is done in order to pacify sparse and be able to add the
__acquires() etc. tags and some of us found it too ugly to
swallow :-)
--
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