* [PATCH 0/2] target: small fixes in pr
@ 2020-04-07 15:21 Bodo Stroesser
2020-04-08 13:26 ` Bodo Stroesser
0 siblings, 1 reply; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-07 15:21 UTC (permalink / raw)
To: target-devel
This small series of patches are the first and the second part
of my previous patch
target: pr: fix PR IN, READ FULL STATUS
broken down to ┬┤two independent patches.
The remaining parts will be handled in future patches by
Mike Christie and thus are obsolete here.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/2] target: small fixes in pr
@ 2020-04-08 13:26 ` Bodo Stroesser
0 siblings, 0 replies; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-08 13:26 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/2] target: small fixes in pr
@ 2020-04-08 13:26 ` Bodo Stroesser
0 siblings, 0 replies; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-08 13:26 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] target: Write NULL to *port_nexus_ptr if no ISID
2020-04-08 13:26 ` Bodo Stroesser
@ 2020-04-08 13:26 ` Bodo Stroesser
-1 siblings, 0 replies; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-08 13:26 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen, Bodo Stroesser
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.
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
---
drivers/target/target_core_fabric_lib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
index 6b4b354c88aa..f5f673e128ef 100644
--- a/drivers/target/target_core_fabric_lib.c
+++ b/drivers/target/target_core_fabric_lib.c
@@ -341,7 +341,8 @@ static char *iscsi_parse_pr_out_transport_id(
*p = tolower(*p);
p++;
}
- }
+ } else
+ *port_nexus_ptr = NULL;
return &buf[4];
}
--
2.12.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 1/2] target: Write NULL to *port_nexus_ptr if no ISID
@ 2020-04-08 13:26 ` Bodo Stroesser
0 siblings, 0 replies; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-08 13:26 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen, Bodo Stroesser
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.
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
---
drivers/target/target_core_fabric_lib.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
index 6b4b354c88aa..f5f673e128ef 100644
--- a/drivers/target/target_core_fabric_lib.c
+++ b/drivers/target/target_core_fabric_lib.c
@@ -341,7 +341,8 @@ static char *iscsi_parse_pr_out_transport_id(
*p = tolower(*p);
p++;
}
- }
+ } else
+ *port_nexus_ptr = NULL;
return &buf[4];
}
--
2.12.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] target: fix PR IN / READ FULL STATUS for FC
2020-04-08 13:26 ` Bodo Stroesser
@ 2020-04-08 13:26 ` Bodo Stroesser
-1 siblings, 0 replies; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-08 13:26 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen, Bodo Stroesser
Creation 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.
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
---
drivers/target/target_core_fabric_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
index f5f673e128ef..1e031d81e59e 100644
--- a/drivers/target/target_core_fabric_lib.c
+++ b/drivers/target/target_core_fabric_lib.c
@@ -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;
--
2.12.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] target: fix PR IN / READ FULL STATUS for FC
@ 2020-04-08 13:26 ` Bodo Stroesser
0 siblings, 0 replies; 11+ messages in thread
From: Bodo Stroesser @ 2020-04-08 13:26 UTC (permalink / raw)
To: linux-scsi, target-devel; +Cc: mchristi, martin.petersen, Bodo Stroesser
Creation 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.
Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
---
drivers/target/target_core_fabric_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
index f5f673e128ef..1e031d81e59e 100644
--- a/drivers/target/target_core_fabric_lib.c
+++ b/drivers/target/target_core_fabric_lib.c
@@ -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;
--
2.12.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] target: small fixes in pr
2020-04-08 13:26 ` Bodo Stroesser
@ 2020-04-09 19:31 ` Mike Christie
-1 siblings, 0 replies; 11+ messages in thread
From: Mike Christie @ 2020-04-09 19:31 UTC (permalink / raw)
To: Bodo Stroesser, linux-scsi, target-devel; +Cc: martin.petersen
On 04/08/2020 08:26 AM, Bodo Stroesser wrote:
> 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.
Reviewed-by: Mike Christie <mchristi@redhat.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] target: small fixes in pr
@ 2020-04-09 19:31 ` Mike Christie
0 siblings, 0 replies; 11+ messages in thread
From: Mike Christie @ 2020-04-09 19:31 UTC (permalink / raw)
To: Bodo Stroesser, linux-scsi, target-devel; +Cc: martin.petersen
On 04/08/2020 08:26 AM, Bodo Stroesser wrote:
> 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.
Reviewed-by: Mike Christie <mchristi@redhat.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] target: small fixes in pr
2020-04-08 13:26 ` Bodo Stroesser
@ 2020-04-13 18:01 ` Martin K. Petersen
-1 siblings, 0 replies; 11+ messages in thread
From: Martin K. Petersen @ 2020-04-13 18:01 UTC (permalink / raw)
To: Bodo Stroesser; +Cc: linux-scsi, target-devel, mchristi, martin.petersen
Bodo,
> The patches fix two issues in target core pr handling.
Applied to 5.7/scsi-fixes, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] target: small fixes in pr
@ 2020-04-13 18:01 ` Martin K. Petersen
0 siblings, 0 replies; 11+ messages in thread
From: Martin K. Petersen @ 2020-04-13 18:01 UTC (permalink / raw)
To: Bodo Stroesser; +Cc: linux-scsi, target-devel, mchristi, martin.petersen
Bodo,
> The patches fix two issues in target core pr handling.
Applied to 5.7/scsi-fixes, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-04-13 18:04 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 15:21 [PATCH 0/2] target: small fixes in pr Bodo Stroesser
2020-04-08 13:26 ` Bodo Stroesser
2020-04-08 13:26 ` Bodo Stroesser
2020-04-08 13:26 ` [PATCH 1/2] target: Write NULL to *port_nexus_ptr if no ISID Bodo Stroesser
2020-04-08 13:26 ` Bodo Stroesser
2020-04-08 13:26 ` [PATCH 2/2] target: fix PR IN / READ FULL STATUS for FC Bodo Stroesser
2020-04-08 13:26 ` Bodo Stroesser
2020-04-09 19:31 ` [PATCH 0/2] target: small fixes in pr Mike Christie
2020-04-09 19:31 ` Mike Christie
2020-04-13 18:01 ` Martin K. Petersen
2020-04-13 18:01 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.