]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: target: core: Generate correct identifiers for PR OUT transport IDs
authorMaurizio Lombardi <mlombard@redhat.com>
Mon, 14 Jul 2025 13:37:38 +0000 (15:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:30 +0000 (18:41 +0200)
commitfd67f7fda7c16d0656bd629f8f4cc3bfdd0c8e62
tree8f62546e5b7ea597aafb5b0e6d73e3ea6e3eb251
parentdd95db01e91a74392ab71ee9154f0a47b96c1059
scsi: target: core: Generate correct identifiers for PR OUT transport IDs

[ Upstream commit 6e0f6aa44b68335df404a2df955055f416b5f2aa ]

Fix target_parse_pr_out_transport_id() to return a string representing
the transport ID in a human-readable format (e.g., naa.xxxxxxxx...)  for
various SCSI protocol types (SAS, FCP, SRP, SBP).

Previously, the function returned a pointer to the raw binary buffer,
which was incorrectly compared against human-readable strings, causing
comparisons to fail.  Now, the function writes a properly formatted
string into a buffer provided by the caller.  The output format depends
on the transport protocol:

* SAS: 64-bit identifier, "naa." prefix.
* FCP: 64-bit identifier, colon separated values.
* SBP: 64-bit identifier, no prefix.
* SRP: 128-bit identifier, "0x" prefix.
* iSCSI: IQN string.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Link: https://lore.kernel.org/r/20250714133738.11054-1-mlombard@redhat.com
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/target_core_fabric_lib.c
drivers/target/target_core_internal.h
drivers/target/target_core_pr.c