linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* scsi_debug: no_lun_0 and lun 49409
@ 2005-10-06  8:22 Douglas Gilbert
  0 siblings, 0 replies; only message in thread
From: Douglas Gilbert @ 2005-10-06  8:22 UTC (permalink / raw)
  To: linux-scsi, patmans

In the downloads section of:
http://www.torque.net/sg/sdebug26.html

is a beta version of scsi_debug version 1.77 .
It simulates a single port of a dual ported SAS disk
(with many of the VPD and mode page trimmings).

This beta adds an extra parameter: "no_lun_0" which
when set to one implements the code suggested by
Pat Mansfield in this post:
http://marc.theaimsgroup.com/?l=linux-scsi&m=112751597527556&w=2

It also goes into unchartered territory and implements
lun 49409 which is the REPORT LUNS well know logical unit.
Those folks out there that are paranoid about "specs"
will be glad (or perhaps disappointed) that it doesn't
break anything. Why do it? Well the spec says that a SCSI
target should either implement:
  - the phantom lun=0 technique, or
  - the REPORT LUNS well known lu
to facilitate lu discovery.

This with lk 2.6.14-rc3 :

# modprobe scsi_debug no_lun_0=1 max_luns=2
# modprobe sg
# cd /sys/class/scsi_host/host0
# echo "- - 49409" > scan
#
# lsscsi -g
[0:0:0:1]    disk    Linux    scsi_debug       0004  /dev/sda  /dev/sg0
[0:0:0:49409]wlun    Linux    scsi_debug       0004  -         /dev/sg1
#
# sg_luns --decode --select=2 /dev/sg1
Lun list length = 16 which imples 2 lun entries
Report luns [select_report=2]:
    0001000000000000
      Peripheral device addressing: lun=1
    c101000000000000
      REPORT LUNS well known logical unit

Notice that 0:0:0:0 is missing but a trace will show that
it did answer an INQUIRY and a REPORT LUNS.

The scsi_debug driver needs to set its Scsi_Host::max_luns
to 49409 so the "echo" above will work. Perhaps the scan
code could be a bit more open minded.

Doug Gilbert

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-10-06  8:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-06  8:22 scsi_debug: no_lun_0 and lun 49409 Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).