From: NeilBrown <neilb@suse.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
Andreas Gruenbacher <agruenba@redhat.com>
Cc: cluster-devel <cluster-devel@redhat.com>,
netdev@vger.kernel.org, Tom Herbert <tom@quantonium.net>,
LKML <linux-kernel@vger.kernel.org>, Thomas Graf <tgraf@suug.ch>
Subject: Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek
Date: Tue, 03 Apr 2018 13:41:26 +1000 [thread overview]
Message-ID: <871sfx0xeh.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20180329170626.GA24218@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]
On Fri, Mar 30 2018, Herbert Xu wrote:
> On Thu, Mar 29, 2018 at 06:52:34PM +0200, Andreas Gruenbacher wrote:
>>
>> Should rhashtable_walk_peek be kept around even if there are no more
>> users? I have my doubts.
>
> Absolutely. All netlink dumps using rhashtable_walk_next are buggy
> and need to switch over to rhashtable_walk_peek. As otherwise
> the object that triggers the out-of-space condition will be skipped
> upon resumption.
Do we really need a rhashtable_walk_peek() interface?
I imagine that a seqfile ->start function can do:
if (*ppos == 0 && last_pos != 0) {
rhashtable_walk_exit(&iter);
rhashtable_walk_enter(&table, &iter);
last_pos = 0;
}
rhashtable_walk_start(&iter);
if (*ppos == last_pos && iter.p)
return iter.p;
last_pos = *ppos;
return rhashtable_walk_next(&iter)
and the ->next function just does
last_pos = *ppos;
*ppos += 1;
do p = rhashtable_walk_next(&iter); while (IS_ERR(p));
return p;
It might be OK to have a function call instead of expecting people to
use iter.p directly.
static inline void *rhashtable_walk_prev(struct rhashtable_iter *iter)
{
return iter->p;
}
Thoughts?
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2018-04-03 3:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 12:06 [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek Andreas Gruenbacher
2018-03-29 12:06 ` [PATCH v2 1/2] lockref: Add lockref_put_not_zero Andreas Gruenbacher
2018-03-29 12:06 ` [PATCH v2 2/2] gfs2: Stop using rhashtable_walk_peek Andreas Gruenbacher
2018-03-29 12:24 ` [Cluster-devel] [PATCH v2 0/2] " Steven Whitehouse
2018-03-29 13:12 ` Andreas Gruenbacher
2018-03-29 12:35 ` Herbert Xu
2018-03-29 13:15 ` Andreas Gruenbacher
2018-03-29 15:41 ` Herbert Xu
2018-03-29 16:52 ` Andreas Gruenbacher
2018-03-29 17:06 ` Herbert Xu
2018-04-03 3:41 ` NeilBrown [this message]
2018-04-03 4:03 ` Herbert Xu
2018-04-04 15:46 ` [Cluster-devel] " Bob Peterson
2018-04-04 15:48 ` Herbert Xu
2018-04-04 16:10 ` Andreas Grünbacher
2018-04-06 1:33 ` [Cluster-devel] " NeilBrown
2018-04-12 17:00 ` Bob Peterson
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=871sfx0xeh.fsf@notabene.neil.brown.name \
--to=neilb@suse.com \
--cc=agruenba@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
--cc=tom@quantonium.net \
/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;
as well as URLs for NNTP newsgroup(s).