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

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

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: 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 20e946d1
......@@ -327,9 +327,10 @@ static void death_by_timeout(unsigned long ul_conntrack)
{
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);
......
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