[ipset-5: 4/9] Fix gfp_flags at resizing

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

 



Resizing functions are called without holding any lock. So we can
allocate using the flag GFP_KERNEL.

Signed-off-by: Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx>
---
 kernel/include/linux/netfilter/ip_set_chash.h |    4 ++--
 kernel/ip_set.c                               |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/include/linux/netfilter/ip_set_chash.h b/kernel/include/linux/netfilter/ip_set_chash.h
index 9a1e26c..f0ef580 100644
--- a/kernel/include/linux/netfilter/ip_set_chash.h
+++ b/kernel/include/linux/netfilter/ip_set_chash.h
@@ -338,7 +338,7 @@ retry:
 		/* In case we have plenty of memory :-) */
 		return -IPSET_ERR_HASH_FULL;
 	t = ip_set_alloc(jhash_size(htable_bits) * sizeof(struct slist),
-			 gfp_flags);
+			 GFP_KERNEL);
 	if (!t)
 		return -ENOMEM;
 
@@ -809,7 +809,7 @@ retry:
 		/* In case we have plenty of memory :-) */
 		return -IPSET_ERR_HASH_FULL;
 	t = ip_set_alloc(jhash_size(htable_bits) * sizeof(struct slist),
-			 gfp_flags);
+			 GFP_KERNEL);
 	if (!t)
 		return -ENOMEM;
 
diff --git a/kernel/ip_set.c b/kernel/ip_set.c
index a1813e2..5e91d50 100644
--- a/kernel/ip_set.c
+++ b/kernel/ip_set.c
@@ -257,7 +257,7 @@ retry:
 	ret = set->variant->kadt(set, skb, IPSET_ADD, family, dim, flags);
 	write_unlock_bh(&set->lock);
 
-	/* Retry function must be called without holding any 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)

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

  Powered by Linux