LIO PERSISTENT RESERVE OUT PREEMPT spec compliance

Stefan Hajnoczi <[email protected]> Wed, 1 Apr 2026 08:46:26 -0400
Newsgroups org.kernel.vger.target-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi
Message-ID <20260401124626.GA266484@fedora>
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
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmnNE6IACgkQnKSrs4Gr
c8ikiAf/WoaYZJjBF+115h2gMN46ygraKh3RQfIcrU2HPIZuTfFo3gaIwrcJGOgP
b9orXoCnjaWL3aMmAkK8PjdHKcKhTuWs2ZxL24uzDIR/zRaWA3QCNc/CZBBQB8E6
wlnDAalS5Om6RlxCSwqE7rcplaQMhIUvI7pqXpzzHcYBhYTXr/75egDfQhbFvxdX
4AyJbtnRSbEZnSiZj56pCxhqSpPugDc6p8frkJ8H2OB6KeGivWjxcZzOYfHJFSxP
S1DjsY5XW4EX2uuOzeTnqrKQGc7UfqnPytgbx4Waa8W4DX6HD6hHWqf80pnBujVK
OaxXv4KxoYR2ws1rZni8VuIA6BhGcg==
=coZs
-----END PGP SIGNATURE-----