parport: fix interruptible_sleep_on race
The interruptible_sleep_on function is can still lead to the deadlock mentioned in the comment above the caller, and we want to remove it soon, so replace it now with the race-free wait_event_interruptible. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Andrew Morton <akpm@osdl.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
74aeac4da6
commit
76ae0536dd
@ -905,7 +905,8 @@ int parport_claim_or_block(struct pardevice *dev)
|
|||||||
/* If dev->waiting is clear now, an interrupt
|
/* If dev->waiting is clear now, an interrupt
|
||||||
gave us the port and we would deadlock if we slept. */
|
gave us the port and we would deadlock if we slept. */
|
||||||
if (dev->waiting) {
|
if (dev->waiting) {
|
||||||
interruptible_sleep_on (&dev->wait_q);
|
wait_event_interruptible(dev->wait_q,
|
||||||
|
!dev->waiting);
|
||||||
if (signal_pending (current)) {
|
if (signal_pending (current)) {
|
||||||
return -EINTR;
|
return -EINTR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user