Thread (6 messages) 6 messages, 3 authors, 2023-09-19

Re: nft_rhash_walk, rhashtable and resize event

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2023-09-18 12:00:46
Also in: gfs2

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:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help