mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
commitb079155faaupstream. Skip GC run if iterator rewinds to the beginning with EAGAIN, otherwise GC might collect the same element more than once. Fixes:f6c383b8c3("netfilter: nf_tables: adapt set backend to use GC transaction API") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
83d3a4607c
commit
8d7a00b904
@@ -338,12 +338,9 @@ static void nft_rhash_gc(struct work_struct *work)
|
||||
|
||||
while ((he = rhashtable_walk_next(&hti))) {
|
||||
if (IS_ERR(he)) {
|
||||
if (PTR_ERR(he) != -EAGAIN) {
|
||||
nft_trans_gc_destroy(gc);
|
||||
gc = NULL;
|
||||
goto try_later;
|
||||
}
|
||||
continue;
|
||||
nft_trans_gc_destroy(gc);
|
||||
gc = NULL;
|
||||
goto try_later;
|
||||
}
|
||||
|
||||
/* Ruleset has been updated, try later. */
|
||||
|
||||
Reference in New Issue
Block a user