piscsi: LUN requires deprecated LUN field and does not evaluate the LUN in the IDENTIFY message

This ticket results from https://github.com/akuker/RASCSI/issues/309.

The LUN field (bits in byte 1 in the CDB) was deprecated in the SCSI standard long ago. The LUN has to be selected by an IDENTIFY message instead. Rascsi ignores the LUN in the IDENTIFY message and always expects the LUN in the CDB. This is not compliant to SCSI and causes the issue reported in https://github.com/akuker/RASCSI/issues/309.

Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] Message code IDENTIFY $C3
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Phase
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Byte 0: $12
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Byte 1: $00
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Byte 2: $00
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Byte 3: $00
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Byte 4: $FF
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SASIDEV::Command() Command Byte 5: $00
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [trace] virtual void SCSIDEV::Execute() Execution phase command $12
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.648] [debug] ++++ CMD ++++ virtual void SCSIDEV::Execute() Executing command $12
Oct 11 21:00:07 raspberrypi RASCSI[432]: [2021-10-11 21:00:07.649] [debug] virtual bool Disk::Dispatch(SCSIDEV*) Executing Inquiry ($12)

The command above has to be executed for LUN 3, but rascsi executes it for LUN 0.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 45 (45 by maintainers)

Most upvoted comments

… and for my final party trick - here is the system with 32 LUNs mounted. (4 IDs x 8 LUNs)

Device               Device           Error    Volume         Free  Trans Mnt
 Name                Status           Count     Label        Blocks Count Cnt
$1$$DKA0:            Mounted              0  BF0728A4BA   140200868   315   1
$1$$DKA100:          Mounted              0  LUN10            20444     1   1
$1$$DKA101:          Mounted              0  LUN11            20444     1   1
$1$$DKA102:          Mounted              0  LUN12            20444     1   1
$1$$DKA103:          Mounted              0  LUN13            20444     1   1
$1$$DKA104:          Mounted              0  LUN14            20444     1   1
$1$$DKA105:          Mounted              0  LUN15            20444     1   1
$1$$DKA106:          Mounted              0  LUN16            20444     1   1
$1$$DKA107:          Mounted              0  LUN17            20444     1   1
$1$$DKA200:          Mounted              0  LUN20           648927     1   1
$1$$DKA201:          Mounted              0  LUN21            20444     1   1
$1$$DKA202:          Mounted              0  LUN22            20444     1   1
$1$$DKA203:          Mounted              0  LUN23            20444     1   1
$1$$DKA204:          Mounted              0  LUN24            20444     1   1
$1$$DKA205:          Mounted              0  LUN25            20444     1   1
$1$$DKA206:          Mounted              0  LUN26            20444     1   1
$1$$DKA207:          Mounted              0  LUN27            20444     1   1
$1$$DKA300:          Mounted              0  LUN30            20444     1   1
$1$$DKA301:          Mounted              0  LUN31            20444     1   1
$1$$DKA302:          Mounted              0  LUN32            20444     1   1
$1$$DKA303:          Mounted              0  LUN33            20444     1   1
$1$$DKA304:          Mounted              0  LUN34            20444     1   1
$1$$DKA305:          Mounted              0  LUN35            20444     1   1
$1$$DKA306:          Mounted              0  LUN36            20444     1   1
$1$$DKA307:          Mounted              0  LUN37            20444     1   1
$1$$DKA400:          Online wrtlck        0
$1$$DKA600:          Mounted              0  LUN60            20444     1   1
$1$$DKA601:          Mounted              0  LUN61            20444     1   1
$1$$DKA602:          Mounted              0  LUN62            20444     1   1
$1$$DKA603:          Mounted              0  LUN63            20444     1   1
$1$$DKA604:          Mounted              0  LUN64            20444     1   1
$1$$DKA605:          Mounted              0  LUN65            20444     1   1
$1$$DKA606:          Mounted              0  LUN66            20444     1   1
$1$$DKA607:          Mounted              0  LUN67            20444     1   1
$1$$DVA0:            Online               0
$
pi@raspberrypi:~/RASCSI $ rasctl -l
+----+----+------+-------------------------------------
| ID | UN | TYPE | DEVICE STATUS
+----+----+------+-------------------------------------
|  1 |  0 | SCHD | /home/pi/images/k.hds
|  1 |  1 | SCHD | /home/pi/images/l.hds
|  1 |  2 | SCHD | /home/pi/images/m.hds
|  1 |  3 | SCHD | /home/pi/images/n.hds
|  1 |  4 | SCHD | /home/pi/images/o.hds
|  1 |  5 | SCHD | /home/pi/images/p.hds
|  1 |  6 | SCHD | /home/pi/images/q.hds
|  1 |  7 | SCHD | /home/pi/images/r.hds
|  2 |  0 | SCHD | /home/pi/images/DEC_RZ55.hds
|  2 |  1 | SCHD | /home/pi/images/a.hds
|  2 |  2 | SCHD | /home/pi/images/b.hds
|  2 |  3 | SCHD | /home/pi/images/c.hds
|  2 |  4 | SCHD | /home/pi/images/d.hds
|  2 |  5 | SCHD | /home/pi/images/e.hds
|  2 |  6 | SCHD | /home/pi/images/f.hds
|  2 |  7 | SCHD | /home/pi/images/g.hds
|  2 |  8 | SCHD | /home/pi/images/h.hds
|  2 |  9 | SCHD | /home/pi/images/i.hds
|  3 |  0 | SCHD | /home/pi/images/s.hds
|  3 |  1 | SCHD | /home/pi/images/t.hds
|  3 |  2 | SCHD | /home/pi/images/u.hds
|  3 |  3 | SCHD | /home/pi/images/v.hds
|  3 |  4 | SCHD | /home/pi/images/w.hds
|  3 |  5 | SCHD | /home/pi/images/x.hds
|  3 |  6 | SCHD | /home/pi/images/y.hds
|  3 |  7 | SCHD | /home/pi/images/z.hds
|  6 |  0 | SCHD | /home/pi/images/1.hds
|  6 |  1 | SCHD | /home/pi/images/2.hds
|  6 |  2 | SCHD | /home/pi/images/3.hds
|  6 |  3 | SCHD | /home/pi/images/4.hds
|  6 |  4 | SCHD | /home/pi/images/5.hds
|  6 |  5 | SCHD | /home/pi/images/6.hds
|  6 |  6 | SCHD | /home/pi/images/7.hds
|  6 |  7 | SCHD | /home/pi/images/8.hds
+----+----+------+-------------------------------------

Pretty impressive!