target: small fixes in pr
Subsystems (2)
cover target: small fixes in pr
This small series is a resend of patches that already were sent to target-devel only.
The patches fix two issues in target core pr handling.
PATCH 1/2 target: Write NULL to *port_nexus_ptr if no ISID
This patch fixes a minor flaw that could be triggered by a PR OUT RESERVE on iSCSI, if TRANSPORT IDs with and without ISID are used in the same command.
In case an ISCSI Transport ID has no ISID, port_nexus_ptr was not used to write NULL, so value from previous call might persist. I don't know, if that ever could happen, but with the change the code is cleaner, I think.
--- drivers/target/target_core_fabric_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/target/target_core_fabric_lib.c +2 -1
@@ -341,7 +341,8 @@ static char *iscsi_parse_pr_out_transport_id( *p =tolower (*p); p++; } - } + }else + *port_nexus_ptr =NULL ;return &buf[4 ]; }
Signature · 1 line
2.12.3
PATCH 2/2 target: fix PR IN / READ FULL STATUS for FC
In reply to Bodo StroesserCreation of the response to READ FULL STATUS fails for FC based reservations. Reason is the too high loop limit (< 24) in fc_get_pr_transport_id(). The string representation of FC WWPN is 23 chars long only ("11:22:33:44:55:66:77:88"). So when i is 23, the loop body is executed a last time for the ending '\0' of the string and thus hex2bin() reports an error.
--- drivers/target/target_core_fabric_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_fabric_lib.c +1 -1
@@ -63,7 +63,7 @@ static int fc_get_pr_transport_id(* encoded TransportID. */ ptr = &se_nacl->initiatorname[0 ]; -for (i =0 ; i <24 ; ) { +for (i =0 ; i <23 ; ) {if (!strncmp (&ptr[i],":" ,1 )) { i++;continue ;
Signature · 1 line
2.12.3
Quoted 5 lines · Bodo Stroesser
This small series is a resend of patches that already were sent to target-devel only.
The patches fix two issues in target core pr handling.
Patches look ok to me and fixes FC for me too.
Martin K. Petersen
AppliedBodo,
Quoted 1 line
The patches fix two issues in target core pr handling.
Applied to 5.7/scsi-fixes, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering