]> granicus.if.org Git - ipset/commitdiff
Fix gfp_flags at resizing
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 29 Oct 2010 20:35:14 +0000 (22:35 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 29 Oct 2010 20:35:14 +0000 (22:35 +0200)
Resizing functions are called without holding any lock. So we can
allocate using the flag GFP_KERNEL.

kernel/include/linux/netfilter/ip_set_chash.h
kernel/ip_set.c

index 9a1e26ca5202c7958d6a40e2b9cf2b96e685b12a..f0ef580b518a11ebe448309525c15d3af867b301 100644 (file)
@@ -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;
 
index a1813e2e251dde3b26c5df08e81515850fd8f20c..5e91d50686f4d95e6c73c3347be54ec7f4399165 100644 (file)
@@ -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)