[SCSI] sg: prevent unwoken sleep
authorJörn Engel <joern@logfs.org>
Thu, 12 Apr 2012 21:33:58 +0000 (17:33 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 17 May 2012 09:08:54 +0000 (10:08 +0100)
srp->done is protected by sfp->rq_list_lock everywhere, except for this
one case.  Result can be that the wake-up happens before the cacheline
with the changed srp->done has arrived, so the waiter can go back to
sleep and never be woken up again.

The wait_event_interruptible() means that anyone trying to debug this
unlikely race will likely notice everything working fine again, as the
next signal will unwedge things.  Evil.

Signed-off-by: Joern Engel <joern@logfs.org>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

No differences found