Re: [usb-storage] mode sense blacklist how

Douglas Gilbert
2003-11-19T23:34:46Z

Pat LaVarre wrote:
> Apologies in advance for each reboot these experiments force on you.
>
>
>> MODE SENSE (10): plscsi hangs and sits there in
>> usb_stor_bulk_transfer_buf until the device is
>> physically unplugged. kill -9 has no effect.
>
>
> Yes why `kill -9` has no effect on SG_IO in progress remains an open
> question here at linux-scsi.

The SG_IO ioctl is implemented in 2 places (in lk 2.6):
a) block/scsi_ioctl.c [for block devices]
b) sg.c [for sg devices]

In case b) the SG_IO ioctl is interruptible between the point
of command submission and the response arriving. [When testing
with lk 2.4 I found there were out-of-resource situations which
would block interminably prior to command submission, but I
doubt this is what you are seeing.] It is worth noting that
coping with orphaned SCSI responses from user killed processes
requires a lot of logic in the sg driver.

I suspect in case a) the user cannot interrupt the sg_io()'s
invocation of blk_do_rq(). Perhaps someone could enlighten me
(and I could document it).

Further it looks like the SCSI_IOCTL_SEND_COMMAND is not
interruptible either. See scsi_wait_req() in scsi_lib.c .

Doug Gilbert