Re: why store the search type in the ieee name field?

Patrick Mansfield
2003-02-11T16:20:39Z

On Mon, Feb 10, 2003 at 05:12:54PM -0600, James Bottomley wrote:
> On Mon, 2003-02-10 at 16:45, Steven Dake wrote:
> > Folks,
> >
> > I was wondering the reasoning behind the code
> >
> > scsi_scan:734
> > /*
> > * All OK - store ID
> > */
> > name[0] = hex_str[id_search->id_type];
> >
> > This corrupts a perfectly good IEEE unique identifier (WWN for FC
> > drives). Is there some usage for this in user space?
>
> Erm, it's appending the type to the beginning of the name string
> (although it does seem to be relying on the sysfs name field being zero
> filled). I don't see any corruption since the inquiry fields and unique
> name name follows this byte.

It should fill in the rest of the 'name' and append a '\0', or return a
failure.

> You get the identifier it found from the sysfs name file for the
> device. The first byte tells you what type of unique name you're
> dealing with.
>
> James

And the identifiers are not unique across different identifier types, so
it has to store the id_type in order to have unique identifiers (at least
for scsi) across all types: for example, a vendor specific id could be the
same as a NAA (IEEE) id.

-- Patrick Mansfield