From: Sagi Grimberg <sagig@dev.mellanox.co.il>
To: "Nicholas A. Bellinger" <nab@daterainc.com>,
target-devel <target-devel@vger.kernel.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
Sagi Grimberg <sagig@mellanox.com>,
Slava Shwartsman <valyushash@gmail.com>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: Re: [PATCH 3/3] iser-target: Handle special case for logout during connection failure
Date: Sun, 22 Mar 2015 18:06:48 +0200 [thread overview]
Message-ID: <550EE898.70209@dev.mellanox.co.il> (raw)
In-Reply-To: <1426918564-22581-4-git-send-email-nab@daterainc.com>
On 3/21/2015 8:16 AM, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
>
> This patch adds special case handling during ISCSI_OP_LOGIN_RSP ib_wr
> failure, where isert_cq_comp_err() is responsible for calling the
> remaining isert_response_completion() -> isert_do_control_comp() ->
> iscsit_logout_post_handler() to drop the last iscsi_conn reference.
>
> It fixes a bug where iscsit_logout_post_handler() would not be called
> if the outgoing ISCSI_OP_LOGIN_RSP failed during iscsi_conn ib_wr
> descriptor cleanup.
>
> Reported-by: Sagi Grimberg <sagig@mellanox.com>
> Reported-by: Slava Shwartsman <valyushash@gmail.com>
> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
> ---
> drivers/infiniband/ulp/isert/ib_isert.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
> index 075b19c..ff0d436 100644
> --- a/drivers/infiniband/ulp/isert/ib_isert.c
> +++ b/drivers/infiniband/ulp/isert/ib_isert.c
> @@ -1996,10 +1996,20 @@ isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc)
>
> desc = (struct iser_tx_desc *)(uintptr_t)wc->wr_id;
> isert_cmd = desc->isert_cmd;
> - if (!isert_cmd)
> + if (!isert_cmd) {
> isert_unmap_tx_desc(desc, ib_dev);
> - else
> - isert_completion_put(desc, isert_cmd, ib_dev, true);
> + } else {
> + struct isert_device *device = isert_conn->conn_device;
> + struct iscsi_conn *conn = isert_conn->conn;
> + struct iscsi_cmd *cmd = isert_cmd->iscsi_cmd;
> +
> + if (cmd->i_state == ISTATE_SEND_LOGOUTRSP &&
> + conn->conn_state == TARG_CONN_STATE_IN_LOGOUT)
> + isert_response_completion(desc, isert_cmd, isert_conn,
> + device->ib_device);
> + else
> + isert_completion_put(desc, isert_cmd, ib_dev, true);
> + }
> } else {
> isert_conn->post_recv_buf_count--;
> if (!isert_conn->post_recv_buf_count)
>
Hey Nic,
Not sure if calling a full logout handler for error completion makes the
most sense here. if this is an error completion it means we are
either in session teardown or just about to start it. So simply
completing conn_logout_comp might be sufficient.
Anyways it might make sense to actually see this type of race happening
before adding this code.
I think this is better off as a standalone patch.
Sagi.
prev parent reply other threads:[~2015-03-22 16:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-21 6:16 [PATCH 0/3] iscsi/iser-target: Convert to kthread.h + fix logout failure Nicholas A. Bellinger
2015-03-21 6:16 ` [PATCH 1/3] iscsi-target: Convert iscsi_thread_set usage to kthread.h Nicholas A. Bellinger
2015-03-23 12:21 ` Sagi Grimberg
2015-03-24 16:37 ` Sagi Grimberg
2015-03-26 6:45 ` Nicholas A. Bellinger
2015-03-21 6:16 ` [PATCH 2/3] iscsi-target: Drop legacy iscsi_target_tq.c logic Nicholas A. Bellinger
2015-03-21 6:16 ` [PATCH 3/3] iser-target: Handle special case for logout during connection failure Nicholas A. Bellinger
2015-03-22 16:06 ` Sagi Grimberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=550EE898.70209@dev.mellanox.co.il \
--to=sagig@dev.mellanox.co.il \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@daterainc.com \
--cc=nab@linux-iscsi.org \
--cc=sagig@mellanox.com \
--cc=target-devel@vger.kernel.org \
--cc=valyushash@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox