Tony Battersby a2dd3b4cea [SCSI] sg: fix races with ioctl(SG_IO)
sg_io_owned needs to be set before the command is sent to the midlevel;
otherwise, a quickly-completing command may cause a different CPU
to see "srp->done == 1 && !srp->sg_io_owned", which would lead to
incorrect behavior.

Check srp->done and set srp->orphan while holding rq_list_lock to
prevent races with sg_rq_end_io().

There is no need to check sfp->closed from read/write/ioctl/poll/etc.
since the kernel guarantees that this won't happen.

The usefulness of sg_srp_done() was questionable before; now it is
definitely not needed.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-03-12 12:58:05 -05:00
..
2009-01-08 16:29:41 +00:00
2009-02-18 17:41:38 -08:00
2009-02-02 23:26:57 -08:00
2009-02-18 15:37:56 -08:00
2009-01-29 18:04:43 -08:00
2009-03-04 21:49:14 +10:00
2009-02-26 10:32:31 -08:00
2009-01-15 16:39:40 -08:00
2009-02-25 13:18:47 +11:00
2009-02-27 16:26:22 -08:00
2009-01-09 03:39:43 -05:00
2009-02-02 19:53:02 +03:00
2009-02-11 14:25:36 -08:00
2009-03-12 12:58:02 -05:00
2009-02-18 15:37:56 -08:00
2009-03-12 12:58:02 -05:00