netfilter: nft_set_pipapo: prepare destroy function for on-demand clone
authorFlorian Westphal <fw@strlen.de>
Thu, 25 Apr 2024 12:06:42 +0000 (14:06 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 14:29:22 +0000 (16:29 +0200)
commit8b8a2417558c632f249abebde97adf8c46540de2
treeffcf5cea66e172c3757c2e38ebfd6b34f53864df
parent80efd2997fb9343a0283cf3cac5524a4595c8ff4
netfilter: nft_set_pipapo: prepare destroy function for on-demand clone

Once priv->clone can be NULL in case no insertions/removals occurred
in the last transaction we need to drop set elements from priv->match
if priv->clone is NULL.

While at it, condense this function by reusing the pipapo_free_match
helper instead of open-coded version.

The rcu_barrier() is removed, its not needed: old call_rcu instances
for pipapo_reclaim_match do not access struct nft_set.

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_set_pipapo.c