Skip to content

Commit 465bbb2

Browse files
committed
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
JIRA: https://issues.redhat.com/browse/RHEL-1720 JIRA: https://issues.redhat.com/browse/RHEL-1721 Upstream Status: commit b079155 commit b079155 Author: Pablo Neira Ayuso <pablo@netfilter.org> Date: Fri Sep 8 01:39:43 2023 +0200 netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration Skip GC run if iterator rewinds to the beginning with EAGAIN, otherwise GC might collect the same element more than once. Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent a28769d commit 465bbb2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

net/netfilter/nft_set_hash.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,9 @@ static void nft_rhash_gc(struct work_struct *work)
338338

339339
while ((he = rhashtable_walk_next(&hti))) {
340340
if (IS_ERR(he)) {
341-
if (PTR_ERR(he) != -EAGAIN) {
342-
nft_trans_gc_destroy(gc);
343-
gc = NULL;
344-
goto try_later;
345-
}
346-
continue;
341+
nft_trans_gc_destroy(gc);
342+
gc = NULL;
343+
goto try_later;
347344
}
348345

349346
/* Ruleset has been updated, try later. */

0 commit comments

Comments
 (0)