Re: SG_IO ioctl (was: mode sense blacklist how)

Pat LaVarre
2003-11-21T21:30:10Z

Offline kindly I'm reminded to distinguish a compelling third "pro" for
SG_IO via block/scsi_ioctl.c:

> > Designing an lk 2.6 user app to recommend more prominent device names
> > like /dev/hdd and /dev/scd0 in place of less prominent /dev/sg$n names
> > thereby steers people into using the less robust pass thru of SG_IO via
> > block/scsi_ioctl.c.
>
> Pat,
> Well it's a trade-off. If you use the SG_IO in
> the block layer then:
>
> Pros:
+ -- - works with ide-cd kernels, not just with ide-scsi kernels
> - convenience (for block devices)
> - no device mapping problems (sd <-> sg) **
> Cons:
> - no help for "non-block" devices: tapes, enclosures,
> OSD, etc
> - inherit block layer policy (e.g. 128 KB xfer limit,
> direct IO alignment)
> - unable to interrupt a SCSI command in progress with
> a signal
> - associated ioctls are dummies or not there, hence unable
> to reset device/bus/host (for example)
> - no driver or host error reporting (only SCSI status)
>
> I'm sure more "cons" will come to light and some will be
> addressed. There is probably enough there already to give
> the cdrecord author pause for thought.

Pat LaVarre