gfs2.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Alexander Aring <aahringo@redhat.com>,
	Network Development <netdev@vger.kernel.org>,
	kadlec@netfilter.org, fw@strlen.de, gfs2@lists.linux.dev,
	David Teigland <teigland@redhat.com>,
	tgraf@suug.ch
Subject: Re: nft_rhash_walk, rhashtable and resize event
Date: Mon, 18 Sep 2023 20:25:30 +0800	[thread overview]
Message-ID: <ZQhButkhI8K6cduD@gondor.apana.org.au> (raw)
In-Reply-To: <ZQg7s8MtByk4kfzP@calendula>

On Mon, Sep 18, 2023 at 01:59:47PM +0200, Pablo Neira Ayuso wrote:
>
> One more question: this walk might miss entries but may it also
> duplicate the same entries?

It depends on what happens during the walk.  If you're lucky
and no resize event occurs during the walk, then you won't miss
any entries or see duplicates.

When a resize event does occur, then we will tell you that it
happened by returning EAGAIN.  It means that you should start
from the beginning and redo the whole walk.  If you do that
then you won't miss anything (although, you may never finish
if the table keeps getting resized).

But obviously duplicates will occur if you take this approach.

> I will work on a patch to update netfilter clients for this code to
> use a rcu linked list.

Sounds good!

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2023-09-18 12:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 14:05 nft_rhash_walk, rhashtable and resize event Alexander Aring
2023-09-16  3:37 ` Herbert Xu
2023-09-18 11:59   ` Pablo Neira Ayuso
2023-09-18 12:25     ` Herbert Xu [this message]
2023-09-18 12:38       ` Alexander Aring
2023-09-19  3:24         ` Herbert Xu

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=ZQhButkhI8K6cduD@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=aahringo@redhat.com \
    --cc=fw@strlen.de \
    --cc=gfs2@lists.linux.dev \
    --cc=kadlec@netfilter.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=teigland@redhat.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).