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

Re: nft_rhash_walk, rhashtable and resize event

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2023-09-16 03:37:56
Also in: gfs2

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.

If you want a stable walk, allocate an extra 8 bytes and use
a linked list.

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help