[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200911161934.00365.remi@remlab.net>
Date: Mon, 16 Nov 2009 19:34:00 +0200
From: "Rémi Denis-Courmont" <remi@...lab.net>
To: paulmck@...ux.vnet.ibm.com
Cc: netdev@...r.kernel.org,
"Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
Subject: Re: [PATCH net-next 1/2] Phonet: put protocols array under RCU
Le lundi 16 novembre 2009 19:26:17 Paul E. McKenney, vous avez écrit :
> On Fri, Nov 13, 2009 at 05:01:18PM +0200, Rémi Denis-Courmont wrote:
> > From: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
> >
> > Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
> > ---
> > net/phonet/af_phonet.c | 20 +++++++++++---------
> > 1 files changed, 11 insertions(+), 9 deletions(-)
> >
> > diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
> > index 8d3a55b..ed65da2 100644
> > --- a/net/phonet/af_phonet.c
> > +++ b/net/phonet/af_phonet.c
> > @@ -35,7 +35,6 @@
> >
> > /* Transport protocol registration */
> > static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
> > -static DEFINE_SPINLOCK(proto_tab_lock);
> >
> > static struct phonet_protocol *phonet_proto_get(int protocol)
> > {
> > @@ -44,11 +43,11 @@ static struct phonet_protocol *phonet_proto_get(int
> > protocol) if (protocol >= PHONET_NPROTO)
> > return NULL;
> >
> > - spin_lock(&proto_tab_lock);
> > + rcu_read_lock();
> > pp = proto_tab[protocol];
>
> Don't we need an rcu_dereference() in here somewhere?
>
> Perhaps something like the following?
Err yes, we do.
--
Rémi Denis-Courmont
http://www.remlab.net/
--
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