From: NeilBrown Date: Tue, 03 Apr 2018 13:41:26 +1000 Subject: [Cluster-devel] [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek In-Reply-To: <20180329170626.GA24218@gondor.apana.org.au> References: <20180329120612.6104-1-agruenba@redhat.com> <20180329123544.GA22551@gondor.apana.org.au> <20180329154153.GA23562@gondor.apana.org.au> <20180329170626.GA24218@gondor.apana.org.au> Message-ID: <871sfx0xeh.fsf@notabene.neil.brown.name> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 832 bytes Desc: not available URL: