From: Chris Leech <cleech@redhat.com>
To: Mike Christie <michael.christie@oracle.com>
Cc: skashyap@marvell.com, lduncan@suse.com, njavali@marvell.com,
mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
jejb@linux.ibm.com
Subject: Re: [PATCH 08/10] scsi: iscsi: Fix nop handling during conn recovery
Date: Fri, 8 Apr 2022 18:59:00 -0700 [thread overview]
Message-ID: <YlDoZMSvD5X+55Mh@localhost> (raw)
In-Reply-To: <20220408001314.5014-9-michael.christie@oracle.com>
On Thu, Apr 07, 2022 at 07:13:12PM -0500, Mike Christie wrote:
> If a offload driver doesn't use the xmit workqueue, then when we are
> doing ep_disconnect libiscsi can still inject PDUs to the driver. This
> adds a check for if the connection is bound before trying to inject PDUs.
>
> Reviewed-by: Lee Duncan <lduncan@suse.com>
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> ---
> drivers/scsi/libiscsi.c | 7 ++++++-
> include/scsi/libiscsi.h | 2 +-
> 2 files changed, 7 insertions(+), 2 deletions(-)
Reviewed-by: Chris Leech <cleech@redhat.com>
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 5e7bd5a3b430..0bf8cf8585bb 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -678,7 +678,8 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
> struct iscsi_task *task;
> itt_t itt;
>
> - if (session->state == ISCSI_STATE_TERMINATE)
> + if (session->state == ISCSI_STATE_TERMINATE ||
> + !test_bit(ISCSI_CONN_FLAG_BOUND, &conn->flags))
> return NULL;
>
> if (opcode == ISCSI_OP_LOGIN || opcode == ISCSI_OP_TEXT) {
> @@ -2214,6 +2215,8 @@ void iscsi_conn_unbind(struct iscsi_cls_conn *cls_conn, bool is_active)
> iscsi_suspend_tx(conn);
>
> spin_lock_bh(&session->frwd_lock);
> + clear_bit(ISCSI_CONN_FLAG_BOUND, &conn->flags);
> +
> if (!is_active) {
> /*
> * if logout timed out before userspace could even send a PDU
> @@ -3318,6 +3321,8 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session,
> spin_lock_bh(&session->frwd_lock);
> if (is_leading)
> session->leadconn = conn;
> +
> + set_bit(ISCSI_CONN_FLAG_BOUND, &conn->flags);
> spin_unlock_bh(&session->frwd_lock);
>
> /*
> diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
> index 84086c240228..d0a24779c52d 100644
> --- a/include/scsi/libiscsi.h
> +++ b/include/scsi/libiscsi.h
> @@ -56,7 +56,7 @@ enum {
> /* Connection flags */
> #define ISCSI_CONN_FLAG_SUSPEND_TX BIT(0)
> #define ISCSI_CONN_FLAG_SUSPEND_RX BIT(1)
> -
> +#define ISCSI_CONN_FLAG_BOUND BIT(2)
>
> #define ISCSI_ITT_MASK 0x1fff
> #define ISCSI_TOTAL_CMDS_MAX 4096
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-04-09 1:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 0:13 [PATCH 00/10] iscsi fixes Mike Christie
2022-04-08 0:13 ` [PATCH 01/10] scsi: iscsi: Move iscsi_ep_disconnect Mike Christie
2022-04-09 1:36 ` Chris Leech
2022-04-08 0:13 ` [PATCH 02/10] scsi: iscsi: Fix offload conn cleanup when iscsid restarts Mike Christie
2022-04-08 17:21 ` Lee Duncan
2022-04-09 1:36 ` Chris Leech
2022-04-08 0:13 ` [PATCH 03/10] scsi: iscsi: Release endpoint ID when its freed Mike Christie
2022-04-08 17:39 ` Lee Duncan
2022-04-09 1:40 ` Chris Leech
2022-04-11 7:22 ` wubo (T)
2022-04-08 0:13 ` [PATCH 04/10] scsi: iscsi: Fix endpoint reuse regression Mike Christie
2022-04-08 17:40 ` Lee Duncan
2022-04-09 1:41 ` Chris Leech
2022-04-08 0:13 ` [PATCH 05/10] scsi: iscsi: Fix conn cleanup and stop race during iscsid restart Mike Christie
2022-04-08 17:48 ` Lee Duncan
2022-04-09 1:46 ` Chris Leech
2022-04-08 0:13 ` [PATCH 06/10] scsi: iscsi: Fix unbound endpoint error handling Mike Christie
2022-04-08 17:55 ` Lee Duncan
2022-04-09 1:54 ` Chris Leech
2022-04-08 0:13 ` [PATCH 07/10] scsi: iscsi: Merge suspend fields Mike Christie
2022-04-09 1:56 ` Chris Leech
2022-04-08 0:13 ` [PATCH 08/10] scsi: iscsi: Fix nop handling during conn recovery Mike Christie
2022-04-09 1:59 ` Chris Leech [this message]
2022-04-08 0:13 ` [PATCH 09/10] scsi: qedi: Fix failed disconnect handling Mike Christie
2022-04-08 16:49 ` [EXT] " Manish Rangankar
2022-04-08 17:58 ` Lee Duncan
2022-04-09 2:00 ` Chris Leech
2022-04-08 0:13 ` [PATCH 10/10] scsi: iscsi: Add Mike Christie as co-maintainer Mike Christie
2022-04-08 17:59 ` Lee Duncan
2022-04-09 1:57 ` Chris Leech
2022-04-08 16:47 ` [EXT] [PATCH 00/10] iscsi fixes Manish Rangankar
2022-04-12 2:36 ` Martin K. Petersen
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=YlDoZMSvD5X+55Mh@localhost \
--to=cleech@redhat.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=jejb@linux.ibm.com \
--cc=lduncan@suse.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=mrangankar@marvell.com \
--cc=njavali@marvell.com \
--cc=skashyap@marvell.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