This is a note to let you know that I've just added the patch titled Target/iscsi: Fix sendtargets response pdu for iser transport to the 3.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: target-iscsi-fix-sendtargets-response-pdu-for-iser-transport.patch and it can be found in the queue-3.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 22c7aaa57e80853b4904a46c18f97db0036a3b97 Mon Sep 17 00:00:00 2001 From: Sagi Grimberg <sagig@xxxxxxxxxxxx> Date: Tue, 10 Jun 2014 18:27:59 +0300 Subject: Target/iscsi: Fix sendtargets response pdu for iser transport From: Sagi Grimberg <sagig@xxxxxxxxxxxx> commit 22c7aaa57e80853b4904a46c18f97db0036a3b97 upstream. In case the transport is iser we should not include the iscsi target info in the sendtargets text response pdu. This causes sendtargets response to include the target info twice. Modify iscsit_build_sendtargets_response to filter transport types that don't match. Signed-off-by: Sagi Grimberg <sagig@xxxxxxxxxxxx> Reported-by: Slava Shwartsman <valyushash@xxxxxxxxx> Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/infiniband/ulp/isert/ib_isert.c | 2 +- drivers/target/iscsi/iscsi_target.c | 14 ++++++++++---- include/target/iscsi/iscsi_transport.h | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -2320,7 +2320,7 @@ isert_put_text_rsp(struct iscsi_cmd *cmd int rc; isert_create_send_desc(isert_conn, isert_cmd, &isert_cmd->tx_desc); - rc = iscsit_build_text_rsp(cmd, conn, hdr); + rc = iscsit_build_text_rsp(cmd, conn, hdr, ISCSI_INFINIBAND); if (rc < 0) return rc; --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -3390,7 +3390,9 @@ static bool iscsit_check_inaddr_any(stru #define SENDTARGETS_BUF_LIMIT 32768U -static int iscsit_build_sendtargets_response(struct iscsi_cmd *cmd) +static int +iscsit_build_sendtargets_response(struct iscsi_cmd *cmd, + enum iscsit_transport_type network_transport) { char *payload = NULL; struct iscsi_conn *conn = cmd->conn; @@ -3467,6 +3469,9 @@ static int iscsit_build_sendtargets_resp struct iscsi_np *np = tpg_np->tpg_np; bool inaddr_any = iscsit_check_inaddr_any(np); + if (np->np_network_transport != network_transport) + continue; + if (!target_name_printed) { len = sprintf(buf, "TargetName=%s", tiqn->tiqn); @@ -3520,11 +3525,12 @@ eob: int iscsit_build_text_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn, - struct iscsi_text_rsp *hdr) + struct iscsi_text_rsp *hdr, + enum iscsit_transport_type network_transport) { int text_length, padding; - text_length = iscsit_build_sendtargets_response(cmd); + text_length = iscsit_build_sendtargets_response(cmd, network_transport); if (text_length < 0) return text_length; @@ -3562,7 +3568,7 @@ static int iscsit_send_text_rsp( u32 tx_size = 0; int text_length, iov_count = 0, rc; - rc = iscsit_build_text_rsp(cmd, conn, hdr); + rc = iscsit_build_text_rsp(cmd, conn, hdr, ISCSI_TCP); if (rc < 0) return rc; --- a/include/target/iscsi/iscsi_transport.h +++ b/include/target/iscsi/iscsi_transport.h @@ -70,7 +70,8 @@ extern void iscsit_build_nopin_rsp(struc extern void iscsit_build_task_mgt_rsp(struct iscsi_cmd *, struct iscsi_conn *, struct iscsi_tm_rsp *); extern int iscsit_build_text_rsp(struct iscsi_cmd *, struct iscsi_conn *, - struct iscsi_text_rsp *); + struct iscsi_text_rsp *, + enum iscsit_transport_type); extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *, struct iscsi_reject *); extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *, Patches currently in stable-queue which might be from sagig@xxxxxxxxxxxx are queue-3.15/target-iser-fix-a-wrong-dereference-in-case-discovery-session-is-over-iser.patch queue-3.15/target-iser-fix-hangs-in-connection-teardown.patch queue-3.15/target-iscsi-fix-sendtargets-response-pdu-for-iser-transport.patch queue-3.15/target-iser-bail-from-accept_np-if-np_thread-is-trying-to-close.patch queue-3.15/libiscsi-iser-adjust-data_length-to-include-protection-information.patch queue-3.15/target-iser-wait-for-proper-cleanup-before-unloading.patch queue-3.15/target-sbc-loopback-adjust-command-data-length-in-case-pi-exists-on-the-wire.patch queue-3.15/target-iser-gracefully-reject-t10-pi-enabled-connect-request-if-not-supported.patch queue-3.15/scsi_cmnd-introduce-scsi_transfer_length-helper.patch queue-3.15/target-iser-improve-cm-events-handling.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html