[NETNS]: Add netns refcnt debug for inet bind buckets.
authorDenis V. Lunev <den@openvz.org>
Wed, 16 Apr 2008 09:01:11 +0000 (02:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Apr 2008 09:01:11 +0000 (02:01 -0700)
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_hashtables.c

index 32ca2f8b581c869c200de2d7dc3a9711f5a3b24a..1612184ecc6f9100b67858f522a90c0437e6d53f 100644 (file)
@@ -35,7 +35,7 @@ struct inet_bind_bucket *inet_bind_bucket_create(struct kmem_cache *cachep,
        struct inet_bind_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC);
 
        if (tb != NULL) {
-               tb->ib_net       = net;
+               tb->ib_net       = hold_net(net);
                tb->port      = snum;
                tb->fastreuse = 0;
                INIT_HLIST_HEAD(&tb->owners);
@@ -51,6 +51,7 @@ void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket
 {
        if (hlist_empty(&tb->owners)) {
                __hlist_del(&tb->node);
+               release_net(tb->ib_net);
                kmem_cache_free(cachep, tb);
        }
 }