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

Module removal can call death_by_timeout() manually, which isn't in softirq
context, so the CONNTRACK_STAT_INC() call there (which assumes preempt
disabled) can give a warning.  Of course, the warning here is spurious, but
the simplest workaround is to call CONNTRACK_STAT_INC() inside the lock.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/net/ipv4/netfilter/ip_conntrack_core.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -puN net/ipv4/netfilter/ip_conntrack_core.c~avoid-warning-on-conntrack_stat_inc-in-death_by_timeout net/ipv4/netfilter/ip_conntrack_core.c
--- 25/net/ipv4/netfilter/ip_conntrack_core.c~avoid-warning-on-conntrack_stat_inc-in-death_by_timeout	2004-10-21 14:55:10.321233040 -0700
+++ 25-akpm/net/ipv4/netfilter/ip_conntrack_core.c	2004-10-21 14:55:10.325232432 -0700
@@ -327,9 +327,10 @@ static void death_by_timeout(unsigned lo
 {
 	struct ip_conntrack *ct = (void *)ul_conntrack;
 
-	CONNTRACK_STAT_INC(delete_list);
-
 	WRITE_LOCK(&ip_conntrack_lock);
+	/* Inside lock so preempt is disabled on module removal path.
+	 * Otherwise we can get spurious warnings. */
+	CONNTRACK_STAT_INC(delete_list);
 	clean_from_lists(ct);
 	WRITE_UNLOCK(&ip_conntrack_lock);
 	ip_conntrack_put(ct);
_
