public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* LIO PERSISTENT RESERVE OUT PREEMPT spec compliance
@ 2026-04-01 12:46 Stefan Hajnoczi
  2026-04-01 15:56 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2026-04-01 12:46 UTC (permalink / raw)
  To: target-devel, Martin K. Petersen; +Cc: linux-scsi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]

Hi,
I've noticed differences in behavior between LIO and HPE 3PAR storage
when handling PERSISTENT RESERVE OUT commands with the PREEMPT service
action.

I'd like to confirm what the behavior should be and will send patches if
necessary:

1. Not ignoring the TYPE field when removing reservations

LIO always checks the TYPE field for PREEMPT and fails requests that
have an invalid TYPE field value (e.g. 0). PREEMPT can be used to remove
registrations (rather than preempting reservations) and in that case
SPC-6 5.14.11.2.5 Removing registrations says "b) ignore the contents of
the SCOPE field and the TYPE field". My interpretation is that LIO
should not check the TYPE field here and it is currently not
spec-compliant.

I compared against HPE 3PAR storage and found that it completes the
command successfully.

2. Removing the I_T nexus registration sending the PREEMPT

When handling a PREEMPT that removes registrations (rather than
preempting reservations), LIO removes all registrations with the given
service action reservation key, including the I_T nexus sending the
PREEMPT.

I think this behavior is supported by SPC-6 5.14.11.2.5 Removing
registrations which says "a) remove the registrations for all I_T
nexuses specified by the SERVICE ACTION RESERVATION KEY field". In other
places the spec explicitly says "except the I_T nexus that is being used
for the PERSISTENT RESERVE OUT command", so I think LIO is correct to
really remove all registrations for the given key.

Note however that HPE 3PAR storage does not remove the registration for
the I_T nexus sending the PREEMPT, so there is a behavioral difference
between LIO and 3PAR.

Thoughts?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: LIO PERSISTENT RESERVE OUT PREEMPT spec compliance
  2026-04-01 12:46 LIO PERSISTENT RESERVE OUT PREEMPT spec compliance Stefan Hajnoczi
@ 2026-04-01 15:56 ` Bart Van Assche
  2026-04-01 17:09   ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2026-04-01 15:56 UTC (permalink / raw)
  To: Stefan Hajnoczi, target-devel, Martin K. Petersen
  Cc: linux-scsi, linux-kernel

On 4/1/26 5:46 AM, Stefan Hajnoczi wrote:
> Thoughts?

There is a persistent reservation compliance test suite in libiscsi.
SCST passes that test suite if I remember correctly. It would be great
if LIO would pass the tests from that test suite too. See also
https://github.com/sahlberg/libiscsi

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: LIO PERSISTENT RESERVE OUT PREEMPT spec compliance
  2026-04-01 15:56 ` Bart Van Assche
@ 2026-04-01 17:09   ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2026-04-01 17:09 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: target-devel, Martin K. Petersen, linux-scsi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Wed, Apr 01, 2026 at 08:56:05AM -0700, Bart Van Assche wrote:
> On 4/1/26 5:46 AM, Stefan Hajnoczi wrote:
> > Thoughts?
> 
> There is a persistent reservation compliance test suite in libiscsi.
> SCST passes that test suite if I remember correctly. It would be great
> if LIO would pass the tests from that test suite too. See also
> https://github.com/sahlberg/libiscsi

Hi Bart,
Thanks for sharing the libiscsi test suite.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-01 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 12:46 LIO PERSISTENT RESERVE OUT PREEMPT spec compliance Stefan Hajnoczi
2026-04-01 15:56 ` Bart Van Assche
2026-04-01 17:09   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox