Problems with SG_IO ioctls on sd device (verses sg device)

Arjan van de Ven arjanv at redhat.com
Wed Jan 26 13:23:02 UTC 2005


On Wed, 2005-01-26 at 11:40 +1100, Burn Alting wrote:
> All,
> 
> I need help. I am using ftp.kernel.org's linux-2.6.10 on a Fedora
> Core 3 system. I eventually want my code to work on a 'clean'
> Fedora Core system, but I have put the ftp.kernel.org's kernel
> up so I can cross-test the same devices with /dev/sgX.
> 
> I have a problem when I use /dev/sdX as opposed to /dev/sgX (eg /dev/sda
> compared to /dev/sg0). I am setting up SCSI write commands of arbitrary
> size, in an sg_io_hdr_t and sending the command to the device with a
> SG_IO ioctl call. I am using a LSI Logic LSIFC929 as the HBA in a Dual
> Xeon server and a raid as the target. I can issue writes up to 2048
> blocks in size to /dev/sg0 but when I write this many to /dev/sda (with
> the same code), it fails.

this is a bug in /dev/sg0; it accepts data bigger than the device
advertised it could take. The result is that it either sends it anyway
(which may well blow up) or silently splits it up internally (at which
point you should wonder if your app shouldn't be the one splitting it
up)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20050126/38dda251/attachment.sig>


More information about the fedora-devel-list mailing list