mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Thomas Graf <tgraf@suug.ch>,
	sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, davem@davemloft.net,
	daniel@iogearbox.net, geert@linux-m68k.org, mroos@linux.ee
Subject: Re: [PATCH] rhashtable: fix for resize events during table walk
Date: Mon, 6 Jul 2015 15:52:30 +0200	[thread overview]
Message-ID: <20150706135230.GC15324@orbit.nwl.cc> (raw)
In-Reply-To: <20150706133040.GA22723@gondor.apana.org.au>

On Mon, Jul 06, 2015 at 09:30:40PM +0800, Herbert Xu wrote:
> On Mon, Jul 06, 2015 at 02:01:42PM +0200, Phil Sutter wrote:
> > diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> > index a60a6d3..e36b94b 100644
> > --- a/lib/rhashtable.c
> > +++ b/lib/rhashtable.c
> > @@ -585,6 +585,7 @@ void *rhashtable_walk_next(struct rhashtable_iter *iter)
> >  	struct bucket_table *tbl = iter->walker->tbl;
> >  	struct rhashtable *ht = iter->ht;
> >  	struct rhash_head *p = iter->p;
> > +	void *rc = NULL;
> >  
> >  	if (p) {
> >  		p = rht_dereference_bucket_rcu(p->next, tbl, iter->slot);
> > @@ -617,12 +618,12 @@ next:
> >  	if (iter->walker->tbl) {
> >  		iter->slot = 0;
> >  		iter->skip = 0;
> > -		return ERR_PTR(-EAGAIN);
> > +		rc = ERR_PTR(-EAGAIN);
> >  	}
> >  
> >  	iter->p = NULL;
> 
> I think a simpler fix would be to move "iter->p = NULL" before
> the if statement.

Done. Thanks for the review!

Cheers, Phil

      reply	other threads:[~2015-07-06 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 12:01 Phil Sutter
2015-07-06 13:30 ` Herbert Xu
2015-07-06 13:52   ` Phil Sutter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150706135230.GC15324@orbit.nwl.cc \
    --to=phil@nwl.cc \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=netdev@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome