From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: Re: [PATCH v2 0/2] gfs2: Stop using rhashtable_walk_peek Date: Tue, 03 Apr 2018 13:41:26 +1000 Message-ID: <871sfx0xeh.fsf@notabene.neil.brown.name> 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> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Cc: cluster-devel , netdev@vger.kernel.org, Tom Herbert , LKML , Thomas Graf To: Herbert Xu , Andreas Gruenbacher Return-path: In-Reply-To: <20180329170626.GA24218@gondor.apana.org.au> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cluster-devel-bounces@redhat.com Errors-To: cluster-devel-bounces@redhat.com List-Id: netdev.vger.kernel.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlrC9+cACgkQOeye3VZi gbm+Gg/9HrfwL/34+UdLALO+iHywnyIrA4C55+jnAWyMf93rosnaldFfPpWZmNgd 6DpWlPKSzDamziaxaaWOtDDIRy1ia4Ig1TgVWe0ZMrnIVqu75ffemzCVV3epHzfw 1ptFAIb0Vlgw1mLLMjcSRXgXO7NMFQV0laVFMnjeReeTBfMYoPhCx0xyTh9dISMl BLMJXpJ6ne84eXqFtMyWCvi1sBdLjK+Xw3Og4nk1spPwiFA7dhfH6VEzImlMyxrL WAD9vDiFFYjcB5wxH+gZ96wLEw2dTQmXEpcslYCQGsTaoTM1RNKfjXICetWiQO95 Jo/0rTozmtUxpcXhMfIyB9zMRpzNNLcKVgQom1tMEKhDiPAvRnfYxyfOkr9k8nd8 65sQqL6kphVRI1me+i3jgGgGdIGuobcM2AdsW2HRv79fr2JOtgkpT+8dTGTvkFHt g51fJjxKCRN3ye6XzJ5oLu32AxZOMblkoIIUK3djLJ9eeNP44DaY5t3qxBUnmxLT bat5oks/omLteabu/fj1PjWxftn2hNsEPwnPHMyylLUl7mqSH0iKdWhqxiZy49i/ ThzfzC9n8wRhBpbYd5+X7ZrJ2DWHh3TmMRiBWdpmqKn/MejLp9XMW2tRI4oI9fsA 97Vvsfi2m4kVvDPmtMmwuSuI5HDh7XMM3lrccLVaaj5cvJ4SG1I= =lo6j -----END PGP SIGNATURE----- --=-=-=--