[ipset-5: 5/9] Remove to support resizing from kernel context.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resizing in kernel context is simply too expensive. Drop the feature:
if a set is used as a dynamic container by a SET target, then the set
must be created with a proper size from now on.

Signed-off-by: Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx>
---
 kernel/ip_set.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/kernel/ip_set.c b/kernel/ip_set.c
index 5e91d50..ad1505d 100644
--- a/kernel/ip_set.c
+++ b/kernel/ip_set.c
@@ -243,7 +243,7 @@ ip_set_add(ip_set_id_t index, const struct sk_buff *skb,
 	   u8 family, u8 dim, u8 flags)
 {
 	struct ip_set *set = ip_set_list[index];
-	int ret = 0, retried = 0;
+	int ret;
 
 	BUG_ON(set == NULL || atomic_read(&set->ref) == 0);
 	pr_debug("set %s, index %u", set->name, index);
@@ -252,17 +252,10 @@ ip_set_add(ip_set_id_t index, const struct sk_buff *skb,
 	    || !(family == set->family || set->family == AF_UNSPEC))
 	    	return 0;
 
-retry:
 	write_lock_bh(&set->lock);
 	ret = set->variant->kadt(set, skb, IPSET_ADD, family, dim, flags);
 	write_unlock_bh(&set->lock);
 
-	/* Resize function must be called without holding any lock */
-	if (ret == -EAGAIN
-	    && set->variant->resize
-	    && (ret = set->variant->resize(set, GFP_ATOMIC, retried++)) == 0)
-	    	goto retry;
-	
 	return ret;
 }
 EXPORT_SYMBOL(ip_set_add);

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux