Unregistering while holding an All Registrants PR

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

 



Hi all,

I am trying out Linux SCSI Target and it seems that the way persistent
reservations are handled does not conform with SPC-4.
SPC4r17 (5.7.10) states that:

    The persistent reservation holder is determined by the type of the
    persistent reservation as follows:
    a) For a persistent reservation of the type Write Exclusive – All
    Registrants or Exclusive Access – All Registrants, the persistent
    reservation holder is any registered I_T nexus;

While Table 51 states that:

    'Write Exclusive – All Registrants' or 'Exclusive Access – All
    Registrants' reservations shall be released when the registration
    for the last registered I_T nexus is removed or when the type or
    scope is changed.

This doesn't seem to be the case with Linux SCSI Target. More
particularly, I have set up an iSCSI target, using the Linux SCSI Target
implementation, and I am connecting to it through two different VMs
using the open-iscsi project.

    root@node1:~# sg_inq /dev/sda 
    standard INQUIRY:
      PQual=0  Device_type=0  RMB=0  version=0x05  [SPC-3]
      [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
      SCCS=1  ACC=0  TPGS=3  3PC=1  Protect=0  BQue=0
      EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
      [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
        length=36 (0x24)   Peripheral device type: disk
     Vendor identification: LIO-ORG 
     Product identification: FILEIO          
     Product revision level: 4.0
     Unit serial number: 9efc01f5-429d-42be-b507-9dc4439f511d

    root@node2:~# sg_inq /dev/sda
    standard INQUIRY:
      PQual=0  Device_type=0  RMB=0  version=0x05  [SPC-3]
      [AERC=0]  [TrmTsk=0]  NormACA=0  HiSUP=0  Resp_data_format=2
      SCCS=1  ACC=0  TPGS=3  3PC=1  Protect=0  BQue=0
      EncServ=0  MultiP=0  [MChngr=0]  [ACKREQQ=0]  Addr16=0
      [RelAdr=0]  WBus16=0  Sync=0  Linked=0  [TranDis=0]  CmdQue=1
        length=36 (0x24)   Peripheral device type: disk
     Vendor identification: LIO-ORG 
     Product identification: FILEIO          
     Product revision level: 4.0
     Unit serial number: 9efc01f5-429d-42be-b507-9dc4439f511d


I register both of the IT_nexuses with the target.

    root@node1:~# sg_persist --out --register --param-sark 0x1 /dev/sda
    root@node2:~# sg_persist --out --register --param-sark 0x2 /dev/sda

    root@node1:~# sg_persist --in --read-full-status /dev/sda 
      LIO-ORG   FILEIO            4.0
      Peripheral device type: disk
      PR generation=0x2
        Key=0x1
          All target ports bit clear
          Relative port address: 0x1
          not reservation holder
          Transport Id of initiator:
            iSCSI name and session id: iqn.1993-08.org.debian:01:node1
        Key=0x2
          All target ports bit clear
          Relative port address: 0x1
          not reservation holder
          Transport Id of initiator:
            iSCSI name and session id: iqn.1993-08.org.debian:01:node2

Then I get a persistent reservation with type 'Exclusive Access - All
Registrants' for node1.

    root@node1:~# sg_persist --out --reserve --prout-type=8 --param-rk=0x1 /dev/sda
    root@node1:~# sg_persist --in --read-full-status /dev/sda 
      LIO-ORG   FILEIO            4.0
      Peripheral device type: disk
      PR generation=0x2
        Key=0x1
          All target ports bit clear
          Relative port address: 0x1
          << Reservation holder >>
          scope: LU_SCOPE,  type: Exclusive Access, all registrants
          Transport Id of initiator:
            iSCSI name and session id: iqn.1993-08.org.debian:01:node1
        Key=0x2
          All target ports bit clear
          Relative port address: 0x1
          not reservation holder
          Transport Id of initiator:
            iSCSI name and session id: iqn.1993-08.org.debian:01:node2

The node2 is listed as "not reservation holder".
Shouldn't node2 be displayed as a Reservation holder since the
persistent reservation is of type 'Exclusive Access, all registrants'?

If I then proceed to unregister node1, the reservation gets released
altogether. Shouldn't the reservation remain, until the last registered
I_T nexus goes away? I think this violates SPC-4, please see the excerpt
above.

    root@node1:~# sg_persist --out --register --param-rk=0x1 --param-sark=0x0 /dev/sda
    root@node1:~# sg_persist --in --read-full-status /dev/sda 
      LIO-ORG   FILEIO            4.0
      Peripheral device type: disk
      PR generation=0x2
        Key=0x2
          All target ports bit clear
          Relative port address: 0x1
          not reservation holder
          Transport Id of initiator:
            iSCSI name and session id: iqn.1993-08.org.debian:01:node2

    root@node2:~# sg_persist --in --read-reservation /dev/sda
      LIO-ORG   FILEIO            4.0
      Peripheral device type: disk
      PR generation=0x2, there is NO reservation held

Is this a bug or am I missing something?

Ilias

Attachment: signature.asc
Description: Digital signature


[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