public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: IDs
@ 2003-01-07 18:54 Andries.Brouwer
  2003-01-07 20:02 ` IDs Patrick Mansfield
  0 siblings, 1 reply; 8+ messages in thread
From: Andries.Brouwer @ 2003-01-07 18:54 UTC (permalink / raw)
  To: Andries.Brouwer, patmans
  Cc: linux-kernel, linux-scsi, linux-usb-devel, mdharm-kernel, zwane

>> The id is not suitable as a user space name. Moreover,
>> it is a heuristic only, and user space needs unambiguous names.

> If we had a complete white/black list of devices with/without a unique id,
> there would be no ambiguity.

You mean for the devices on the white list.
But most devices will not be on the white list.

Our perceptions differ, I think. My impression is that chaos
is the norm, and well-behaved devices are the exception.
I find very good behaviour in fixed hard disks.
Stuff by Maxtor, Seagate, IBM, etc - a very small collection
of very experienced manufacturers with high quality products.
SCSI CDROM drives or tape drives or scanners are messier.
USB storage devices are much messier - very basic parts of the
protocol are regularly broken.
So to me the approach of an id together with a blacklist
seems unworkable.

As you say - we can make a best effort and get a string that
with some luck identifies the device uniquely. But no guarantees
given.

Maybe that again means that the S/Z distinction can be dropped.

Andries


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: IDs
@ 2003-01-07 10:55 Andries.Brouwer
  2003-01-07 18:02 ` IDs Patrick Mansfield
  0 siblings, 1 reply; 8+ messages in thread
From: Andries.Brouwer @ 2003-01-07 10:55 UTC (permalink / raw)
  To: Andries.Brouwer, patmans
  Cc: linux-kernel, linux-scsi, linux-usb-devel, mdharm-kernel, zwane

> But, we don't have to truncate, we should just allocate as many bytes as
> we need, and store the information.

> And, the sysfs name should not store the id.

OK. It seems that we are in total agreement.
Time for the next question.

An id is constructed, that in many cases identifies something.
How do you plan to use this? Is it already in use somewhere?

The sysfs tree does not contain device nodes.
Do you plan a user space utility that figures out that
the ID "SHP      CD-Writer+ 8200 [" belongs to /dev/hdd
which also is /dev/sr0?

The id is not suitable as a user space name. Moreover,
it is a heuristic only, and user space needs unambiguous names.
What user space names do you want to use?

Andries

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: IDs
@ 2003-01-07  2:19 Andries.Brouwer
  2003-01-07  3:15 ` IDs Patrick Mansfield
  0 siblings, 1 reply; 8+ messages in thread
From: Andries.Brouwer @ 2003-01-07  2:19 UTC (permalink / raw)
  To: Andries.Brouwer, patmans
  Cc: linux-kernel, linux-scsi, linux-usb-devel, mdharm-kernel, zwane

> We can tell if the id sdev->name should be unique by looking at
> the first byte (it is not unique if the value is 'Z'),
> SCSI_UID_UNKNOWN.

Such things are nontrivial.

% cat /sysfs/devices/ide-scsi/0:0:0:0/0:0:0:0/name
SHP      CD-Writer+ 8200 [

Here the serial number consists of the '[' only.
(And this is not because of truncation.)

I can see your intentions, but view these names/ids more
like heuristics than like reliable data.
More or less like mount, which will usually figure out the
filesystem type for you, but no guarantees are given.

And where we have heuristics only, it cannot be "wrong"
to truncate at 50 positions or so. The heuristic does
not become appreciably weaker.

(And, in case of heuristics, I like 98% heuristics better
than 99.98% heuristics. They keep you honest. No important
things will depend upon them. With 99.98% one may forget
that it is a heuristic.)

Andries

^ permalink raw reply	[flat|nested] 8+ messages in thread
* IDs
@ 2003-01-07  0:00 Andries.Brouwer
  2003-01-07  2:13 ` IDs Patrick Mansfield
  0 siblings, 1 reply; 8+ messages in thread
From: Andries.Brouwer @ 2003-01-07  0:00 UTC (permalink / raw)
  To: Andries.Brouwer, patmans
  Cc: linux-kernel, linux-scsi, linux-usb-devel, mdharm-kernel, zwane

> Instead of truncating the id, we need a new scsi_uid field allocated
> to whatever size required.

> And, a descriptive string put in the name, rather than the id, such as:
> scsi disk

[I changed the Subject line "Re: inquiry in scsi_scan.c" since people
are still discussing devices with a buggy INQUIRY response;
maybe unnecessarily - all details are well understood, and
patches fixing all problems have been posted, but in any case
it is best to separate both threads.]

Maybe I should ask you to explain more in detail what purpose
you have in mind. If I read your code and hear you talking
it sounds like you would like to have a string identifying
the device. But in many cases no such string exists.

Moreover, what precisely is "the device"?
If I have a Compact Flash card reader and read CF cards,
is the device the reader? Or the card? Or the combination?
If I have an Imation FlashGo! reader, and insert a SmartMedia
adapter, and read a SmartMedia card, is the device the reader,
the reader plus adapter, the card?

If the device is the reader, then it will have a different size,
partitioning and contents each time we see it.
If the device is the card, then we need a different driver
each time we see it.

What do you want to recognize with this ID, and why?


Andries


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-01-07 20:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-07 18:54 IDs Andries.Brouwer
2003-01-07 20:02 ` IDs Patrick Mansfield
  -- strict thread matches above, loose matches on Subject: below --
2003-01-07 10:55 IDs Andries.Brouwer
2003-01-07 18:02 ` IDs Patrick Mansfield
2003-01-07  2:19 IDs Andries.Brouwer
2003-01-07  3:15 ` IDs Patrick Mansfield
2003-01-07  0:00 IDs Andries.Brouwer
2003-01-07  2:13 ` IDs Patrick Mansfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox