Re: open by devname

From: Unknown
Date: Tue Aug 10 2004 - 16:55:03 EST


>From axboe@xxxxxxx Mon Jan 12 16:50:19 2004


>With 2.6 and SG_IO for generic block devices, it's pretty annoying and
>confusing to users that cdrecord outputs:

>"Open by 'devname' is unintentional and not supported."

The reason is to tell people that they are going to use an annoying
interface that is not really needed and that breaks the SCSI protocol layering.

In addition, it tells users that there may be problems because the Linux
kernel folks did not include correct ioctl interfaces for

ioctl(f, SCSI_IOCTL_GET_IDLUN, &sg_id)

ioctl(f, SCSI_IOCTL_GET_BUS_NUMBER, &Bus)

and

ioctl(scgp->fd, SG_EMULATED_HOST, &emulated)

but just implemented dummies that may cause problems.

>This leads them to think they did something wrong, which they really
>didn't. Any chance you could be talked into taking that message out?

Sorry no, because what you wrote is only halfway correct.

They are forced to use something inherently wrong because the Linux kernel
now includes another SCSI interface that is not needed. Note that the
efforts that have ben put into writing this piece of code should have better
be put into writing an orthogonal DMA access interface and fixing the
DMA problems that cause DMA sizes % 512 != 0 to disable DMA for _all_ devices
and _all_ interfaces provided by the kernel.

Open by devname definitly breaks clean protocol layering on a OS
where you already have a generic SCSI transport interface like Linux has
with /dev/sg*

The vanilla way to go is to run cdrecord -scanbus and then
use one of the listed devices.

ATAPI is SCSI over ATA transport and there are a lot of different official
SCSI transport media.

ide-scsi is not the best possible solution, but it definitely fits much better
into a clean layering model than what Linux Torvalds likes to
enforce (note that he doesn't own any CD writer so he is definitely unable
to even judge about the problems).

I really hope that Jeff Garzik continues to implement his clean way of dealing
with ATAPI devices and that the ugly /dev/hd* based SCSI interface is becoming
obsolete soon.

libscg does not offer a service that is at the layering level that
the /dev/hd* driver provides.

libscg instead offers a service that is just below the service of
the /dev/hd* driver.

It makes no sense to use naming schemes made for high level device
acces for low level tasks like SCSI command transport.

Libscg provides an interface for the mid level SCSI transport.
This protocol level is _above_ the Hostadaptordriver where transport
specific things are handled. It is _below_ the Blockdevice layer
where hard disk, CD-ROM and Tape specifics are handled. Libscg provides
just the protocol layer that is used by the lower end of the block device
drivers. It is inapropriate to use a naming scheme that applies to a higher
protocol layer that is not used by libscg.

Forcing users to be unable to list all devices that use the SCSI protocol
in a single name space is just a bad idea.

As kernels usually use instance numbers for internal purposes, it is obvious
to use just something similar to implement the name space for libscg.

/*--------------------------------------------------------------------------*/


Jörg

--
EMail:joerg@xxxxxxxxxxxxxxxxxxxxxxxxxxx (home) Jörg Schilling D-13353 Berlin
js@xxxxxxxxxxxxxxx (uni) If you don't have iso-8859-1
schilling@xxxxxxxxxxxxxxxxxxx (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/