diff options
| author | Ciro Iriarte <ciro.iriarte+software@gmail.com> | 2026-10-31 22:21:39 -0300 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-11-08 22:23:44 -0500 |
| commit | 08f08a6d49efc422258edba802faa4fc7677309e (patch) | |
| tree | 7b76255d1f1c4449f023e06f14a78b11309c7890 /scripts/Makefile.thinlto | |
| parent | 48d3b732e5ad3fffe74e033d9a3cf47ebaa314b0 (diff) | |
| download | linux-next-08f08a6d49efc422258edba802faa4fc7677309e.tar.gz linux-next-08f08a6d49efc422258edba802faa4fc7677309e.zip | |
scsi: target: core: Parse APTPL res_type and res_scope as hex
core_scsi3_update_aptpl_buf() saves the reservation holder's type and scope
to the APTPL metadata file as zero-padded hex ("res_type=%02x",
"res_scope=%02x"), but target_pr_res_aptpl_metadata_store() reads them back
with "%d" tokens and match_int(), which parse with base 0. A leading zero
selects octal, so match_token() parses only the "0" of "res_type=08", the
trailing "8" makes the token not match, and the field is ignored as
unknown. An Exclusive Access - All Registrants holder (type 0x8) is left
with type 0 and the write fails with -EINVAL and
Illegal PR type: 0x00 for reservation holder
Userspace that restores APTPL state by writing the saved records back to
pr/res_aptpl_metadata (rtslib-fb does this when it recreates a storage
object) therefore loses every type 8 reservation across a target restart,
and with rtslib the storage object creation fails. The other valid types
(1, 3, 5, 6, 7) and scope 0 only work because their octal and decimal
values coincide.
Keep the on-disk format and parse both fields as hex. The valid type and
scope values have the same hex and decimal representation, so records
written in decimal by hand keep working.
Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Cc: stable@vger.kernel.org
Signed-off-by: Ciro Iriarte <ciro.iriarte+software@gmail.com>
Link: https://patch.msgid.link/ea903e6c-09b5-4a11-80e8-6e1387f39ef5@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
