Re: define the scsi serial number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2012-10-08 at 19:18 -0400, Brian J. Murrell wrote:
> Just to followup here on a bit of digging I've been doing...
> 
> The only place in the configfs tree that I can anything that resembles
> the value that "scsi_id -g" on the initiator returns is in:
> 
> /sys/kernel/config/target/core/*/*/wwn/vpd_assoc_logical_unit, for example:
> 
> T10 VPD Identifier Association: addressed logical unit
> T10 VPD Identifier Type: NAA
> T10 VPD Binary Device Identifier: 360014058da4cbf2d90f3d4404d962ed8
> T10 VPD Identifier Association: addressed logical unit
> T10 VPD Identifier Type: T10 Vendor ID based
> T10 VPD ASCII Device Identifier: LIO-ORG
> 
> I'm guessing that I cannot set the contents of this file though, can I?  When I try I get:
> 
> # cat /sys/kernel/config/target/core/iblock_2/sdc/wwn/vpd_assoc_logical_unit >/tmp/foo
> # sed -i -e 's/360014058da4cbf2d90f3d4404d962ed8/wc35_sda/' /tmp/foo
> # cat > /sys/kernel/config/target/core/iblock_2/sdc/wwn/vpd_assoc_logical_unit </tmp/foo
> cat: write error: Function not implemented
> 

That is correct, because the IEEE NAA Registered Extended Device
Identifier is required to be in a specific format as per >= SPC-3
standards. 

The Unit Serial Number (that the above 360001405 prefixed IEEE NAA
Registered Extended Device Identifier is based upon) is implementation
dependent, and does not define a specific format other than the value
needs to be world wide unique.

> Ultimately I am trying to achieve what the following does with the tgtd
> iSCSI target:
> 
> <target iqn.2008-09.wc35:server.target1>
>     <direct-store /dev/sda>
>         scsi_id wc35_sda
>     </direct-store>
> </target>
> 
> When I give that configuration to tgtd on the initiator, scsi_id -g
> returns "wc35_sda".
> 

So we hard-code the prefix for the IEEE NAA Registered Extended Device
Identifier in target kernel code to follow what SCSI clients expect for
this specific type of EVPD=0x83 designator.  We do not allow target-mode
user-space code to set this value to a format containing a value that
SCSI clients do not expect.

Using a non world-wide unique value for the one value that initiators
depend on as being world-wide queue is a *bad* idea.

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux