[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZQg7s8MtByk4kfzP@calendula>
Date: Mon, 18 Sep 2023 13:59:47 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Alexander Aring <aahringo@...hat.com>,
Network Development <netdev@...r.kernel.org>, kadlec@...filter.org,
fw@...len.de, gfs2@...ts.linux.dev,
David Teigland <teigland@...hat.com>, tgraf@...g.ch
Subject: Re: nft_rhash_walk, rhashtable and resize event
Hi Herbert,
On Sat, Sep 16, 2023 at 11:37:51AM +0800, Herbert Xu wrote:
> On Fri, Sep 15, 2023 at 10:05:06AM -0400, Alexander Aring wrote:
> >
> > My question is here? Is that allowed to do because a resize event may
> > change the order how to iterate over a rhashtable.
>
> Walking over an rhashtable should be a last resort. There is
> no guarantee of stability.
>
> If you skip entries after a resize then you may miss entries.
One more question: this walk might miss entries but may it also
duplicate the same entries?
> If you want a stable walk, allocate an extra 8 bytes and use
> a linked list.
I will work on a patch to update netfilter clients for this code to
use a rcu linked list.
Thanks.
Powered by blists - more mailing lists