[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151222215400.GA14148@codemonkey.org.uk>
Date: Tue, 22 Dec 2015 16:54:00 -0500
From: Dave Jones <davej@...emonkey.org.uk>
To: David Miller <davem@...emloft.net>
Cc: kraigatgoog@...il.com, netdev@...r.kernel.org,
herbert@...dor.apana.org.au
Subject: Re: suspicious RCU usage (netlink/rhashtable)
On Tue, Dec 22, 2015 at 04:50:20PM -0500, David Miller wrote:
> > > > Simple fix is below. Though, I don't understand the history of the
> > > > multiple locks in this structure to be sure it's correct. I'll send
> > > > it as a formal patch. Please reject if it's not the right approach.
> > > >
> > > > diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> > > > index 1c149e9..cc80870 100644
> > > > --- a/lib/rhashtable.c
> > > > +++ b/lib/rhashtable.c
> > > > @@ -516,7 +516,8 @@ int rhashtable_walk_init(struct rhashtable *ht,
> > > > struct rhashtable_iter *iter)
> > > > return -ENOMEM;
> > > >
> > > > spin_lock(&ht->lock);
> > > > - iter->walker->tbl = rht_dereference(ht->tbl, ht);
> > > > + iter->walker->tbl =
> > > > + rcu_dereference_protected(ht->tbl, lockdep_is_held(&ht->lock));
> > > > list_add(&iter->walker->list, &iter->walker->tbl->walkers);
> > > > spin_unlock(&ht->lock);
> > >
> > > How can this be the "fix"? That's exactly what's in the tree.
> >
> > I should have made clear, this is Linus' tree I'm hitting this on,
> > which matches what Craig posted.
>
> Ok, so this should be fixed in my 'net' tree and I'll send that to Linus
> soon.
Great, thanks Dave. Sorry for the fire-alarm :)
Dave
--
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