Skip to content

Commit

Permalink
xfrm: Fix xfrm_policy_gc_lock handling.
Browse files Browse the repository at this point in the history
From: Alexey Dobriyan <adobriyan@gmail.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@davemloft.net>
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Nov 4, 2008
1 parent 19ecb6b commit bbb770e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit bbb770e

Please sign in to comment.