Commit e3f31479 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[NETFILTER]: Avoid warning on CONNTRACK_STAT_INC in destroy_conntrack()

From: Rusty Russell <rusty@rustcorp.com.au>

ip_conntrack_put can be called in any context in theory: in particular,
MASQUERADE will can call it (via ip_ct_selective_cleanup) when an interface
comes up with a different address.

Move the CONNTRACK_STAT_INC inside the lock: it needs preemption disabled.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b9573ffd
......@@ -312,6 +312,7 @@ destroy_conntrack(struct nf_conntrack *nfct)
}
kmem_cache_free(ip_conntrack_expect_cachep, ct->master);
}
CONNTRACK_STAT_INC(delete);
WRITE_UNLOCK(&ip_conntrack_lock);
if (master)
......@@ -320,7 +321,6 @@ destroy_conntrack(struct nf_conntrack *nfct)
DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct);
kmem_cache_free(ip_conntrack_cachep, ct);
atomic_dec(&ip_conntrack_count);
CONNTRACK_STAT_INC(delete);
}
static void death_by_timeout(unsigned long ul_conntrack)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment