From: Alexey Dobriyan Date: Tue, 4 Nov 2008 03:11:29 +0000 (-0800) Subject: xfrm: Fix xfrm_policy_gc_lock handling. X-Git-Tag: v2.6.28-rc4~86^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=bbb770e7ab9a436752babfc8765e422d7481be1f;p=linux-2.6-omap-h63xx.git xfrm: Fix xfrm_policy_gc_lock handling. From: Alexey Dobriyan 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 --- diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 25872747762..058f04f54b9 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); }