From ab37682708b57c664acdf7b9122773bc71d25bde Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Sun, 26 Oct 2014 00:11:29 +0200 Subject: Fix parallel resizing and listing of the same set When elements added to a hash:* type of set and resizing triggered, parallel listing could start to list the original set (before resizing) and "continue" with listing the new set. Fix it by references and using the original hash table for listing. Therefore the destroying the original hash table may happen from the resizing or listing functions. --- tests/hash:ip.t | 4 ++++ tests/resize-and-list.sh | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100755 tests/resize-and-list.sh (limited to 'tests') diff --git a/tests/hash:ip.t b/tests/hash:ip.t index 2ad6831..a3ab1e2 100644 --- a/tests/hash:ip.t +++ b/tests/hash:ip.t @@ -58,6 +58,10 @@ 0 ipset -W test resize-test # IP: Check listing, which requires multiple messages 0 n=`ipset -S test | wc -l` && test $n -eq 8161 +# IP: Flush sets +0 ipset -F +# IP: Run resize and listing parallel +0 ./resize-and-list.sh # IP: Destroy sets 0 ipset -X # IP: Create set to add a range diff --git a/tests/resize-and-list.sh b/tests/resize-and-list.sh new file mode 100755 index 0000000..209408a --- /dev/null +++ b/tests/resize-and-list.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +./resize.sh & +n=0 +while [ $n -ne 8161 ]; do + echo $n + n=`ipset -S resize-test | wc -l` +done +ipset x + + \ No newline at end of file -- cgit v1.2.3