[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20081103.191210.149092227.davem@davemloft.net>
Date: Mon, 03 Nov 2008 19:12:10 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: adobriyan@...il.com
Cc: simon@...e.lp0.eu, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: xfrm_policy_kill: inconsistent {softirq-on-W} ->
{in-softirq-W} usage
From: Alexey Dobriyan <adobriyan@...il.com>
Date: Mon, 3 Nov 2008 23:57:26 +0300
> If it's easily reproducible, try this patch:
>
> --- a/net/xfrm/xfrm_policy.c
> +++ b/net/xfrm/xfrm_policy.c
> @@ -315,9 +315,9 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
This looks clearly like the correct fix for this lockdep
warning, so I'm adding it to net-2.6 as follows even though
Simon can't readily test it.
Thanks.
commit bbb770e7ab9a436752babfc8765e422d7481be1f
Author: Alexey Dobriyan <adobriyan@...il.com>
Date: Mon Nov 3 19:11:29 2008 -0800
xfrm: Fix xfrm_policy_gc_lock handling.
From: Alexey Dobriyan <adobriyan@...il.com>
Based upon a lockdep trace by Simon Arlott.
xfrm_policy_kill() can be called from both BH and
non-BH contexts, so we have to grab xfrm_policy_gc_lock
with BH disabling.
Signed-off-by: David S. Miller <davem@...emloft.net>
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 2587274..058f04f 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -315,9 +315,9 @@ static void xfrm_policy_kill(struct xfrm_policy *policy)
return;
}
- spin_lock(&xfrm_policy_gc_lock);
+ spin_lock_bh(&xfrm_policy_gc_lock);
hlist_add_head(&policy->bydst, &xfrm_policy_gc_list);
- spin_unlock(&xfrm_policy_gc_lock);
+ spin_unlock_bh(&xfrm_policy_gc_lock);
schedule_work(&xfrm_policy_gc_work);
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists