]> Git Repo - linux.git/commit
atm/svc: Fix blocking in wait loop
authorchas williams - CONTRACTOR <[email protected]>
Tue, 12 Aug 2014 12:12:26 +0000 (08:12 -0400)
committerDavid S. Miller <[email protected]>
Thu, 14 Aug 2014 03:04:46 +0000 (20:04 -0700)
commitde713b57947a7a1b9cc605c0296ee14065cd86b6
treed47fa60ae55956e23ff7c1d57c32bdcafd3f65f8
parent10545937e866ccdbb7ab583031dbdcc6b14e4eb4
atm/svc: Fix blocking in wait loop

One should not call blocking primitives inside a wait loop, since both
require task_struct::state to sleep, so the inner will destroy the
outer state.

sigd_enq() will possibly sleep for alloc_skb().  Move sigd_enq() before
prepare_to_wait() to avoid sleeping while waiting interruptibly.  You do
not actually need to call sigd_enq() after the initial prepare_to_wait()
because we test the termination condition before calling schedule().

Based on suggestions from Peter Zijlstra.

Signed-off-by: Chas Williams <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/atm/svc.c
This page took 0.052002 seconds and 4 git commands to generate.