Re: sg driver and Fedora Core 2

Jeff Garzik
2004-05-29T17:42:30Z

Alan Cox wrote:
> On Sat, May 29, 2004 at 01:27:58PM -0400, Jeff Garzik wrote:
>
>>Really what needs to happen is a generic userland tap attaches to a
>>chrdev, issues an ioctl(2) to attach to a request_queue, and then does
>>read(2)/write(2)/mmap(2) to communicate with the request_queue.
>
>
> Is there a reason that couldn't be part of the block layer sysfs in 2.7.x
>
>
>>:)
>>Call it /dev/bsg, or somesuch.
>
>
> Except that I wonder if it should be in sysfs I agree entirely.

I'll let others haggle over the device name and location <grin> sysfs
or whereever is fine with me. I just care about the chrdev's behavior :)

>> OTOH, the SG_IO ioctl does eliminate the userland app needing to
>>worry about _any_ target/addressing information, since that is implicit
>>in the dentry pointing to the blkdev's inode.
>
>
> It makes it very hard to scan scsi busses, which is what the flash burner
> app does, and what xsane does (although sane survives ok because there
> are no kernel scanner device drivers)

This is precisely the problem with the only-SG_IO approach as well:

AFAICS, you lose the ability to scan the bus, just as you gain the
ability to not have to care about scanning the bus. Getting back on
topic, I agree with you that the Fedora change [if it is as you
describe] is not a good one. And breakage in a stable kernel version is
also quite annoying.

Jeff