Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Douglas Gilbert <dougg@torque.net>
Cc: Bodo Eggert <7eggert@gmx.de>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Move SG_GET_SCSI_ID from sg to scsi
Date: Mon, 27 Mar 2006 09:15:35 -0800 (PST)
Message-ID: <Pine.LNX.4.64.0603270854570.15714@g5.osdl.org> (raw)
In-Reply-To: <4427FEC9.4010803@torque.net>



On Mon, 27 Mar 2006, Douglas Gilbert wrote:
>
> There are two things that really count:
>   1) the identifier (preferably a world wide unique name)
>      of the logical unit that is being addressed
>   2) a topological description of how that logical unit
>      is connected

And "SCSI ID" doesn't describe either.

> Linux's <hctl> may be a ham fisted way of describing
> a path through a topology, but it easily beats /dev/sdabc
> and /dev/sg4711 .

Sure, you can easily beat it by selecting what you compare it against.

But face it, /dev/sdabc or /dev/sg4711 simply isn't what you should 
compare against. What you should compare against is

	/dev/cdrom
	/sys/bus/ide/devices/0.0/block:hda/dev
	/dev/uuid/3d9e6e8dfaa3d116
	..

and a million OTHER ways to specify which device you're interested in.

The fact is, they can potentially all do the SCSI command set. And a "SCSI 
ID" makes absolutely zero sense for them (those three devices may be the 
same device, they may not be, they might be on another machine, who 
knows..)

> With a device node name like /dev/sdabc, a SCSI INQUIRY or
> an ATA IDENTIFY DEVICE command can be sent to ascertain 1)
> but I am unaware of any command sent to a logical unit that
> will yield 2).

AND NEITHER WILL SCSI_ID. So what the h*ll is your point?

If you want to know how the damn thing is physically connected, you want 
to use a path like

	/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block:sda/dev

Note how, for example, this says 0:0:0:0, which happens to be the 
controller/channel/id/lun information for that "SCSI device". Notice how 
it is all zeroes? It's because that whole concept doesn't make any sense 
for things like USB storage, which has a totally different way to address 
the things.

But that thing really _does_ describe the physical location of that block 
device (actually, that particular file just contains the information about 
what the device node is for the device, but never mind).

And if you want to _use_ the device, you'd probably use a name like 
/dev/disk/by-path/usb-0F406C5032802890:0:0:0 (which is that same device, 
actually), or, more commonly /dev/disk/by-uuid/1468B594FC37ECF8, which 
happens to be the second partition on that physical device and which 
stays the same even when you plug that same disk in with firewire.

(Or, in this case, you migt actually want to use /dev/disk/by-label/rEFIt, 
which is that same partition on that USB device, but in a human-readable 
labeled form).

Again, the "SCSI ID" is a total and utter crock. IT HAS ABSOLUTELY NO 
VALID USE. It does _not_ describe what you claim it describes, and it is 
_not_ in any way superior to all the other ways of getting to that device.

		Linus

  reply index

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-26 19:28 Bodo Eggert
2006-03-26 19:51 ` Arjan van de Ven
2006-03-26 20:08   ` Matthew Wilcox
2006-03-26 20:41     ` Arjan van de Ven
2006-03-26 20:05 ` Matthew Wilcox
2006-03-27 10:11   ` Bodo Eggert
2006-03-27 15:20     ` Matthew Wilcox
2006-03-27 15:40       ` James Bottomley
2006-03-26 22:30 ` Linus Torvalds
2006-03-26 23:19   ` Jan Engelhardt
2006-03-27  0:06     ` Linus Torvalds
2006-03-27 11:42   ` Bodo Eggert
2006-03-28  9:43     ` Matthias Andree
2006-03-27 15:03   ` Douglas Gilbert
2006-03-27 17:15     ` Linus Torvalds [this message]
2006-03-27 17:25       ` Matthew Wilcox
2006-03-27 17:43         ` Linus Torvalds
2006-03-27 19:54           ` Alan Cox
2006-03-27 21:29             ` Douglas Gilbert
2006-03-28  7:37               ` Stefan Richter
2006-03-28 14:17                 ` Jan Engelhardt
2006-03-26 23:09 ` Stefan Richter

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0603270854570.15714@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=7eggert@gmx.de \
    --cc=dougg@torque.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git