All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: Mike Christie <michael.christie@oracle.com>,
	cleech@redhat.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 V3 04/15] scsi: iscsi: Fix nop handling during conn recovery
Date: Fri, 1 Apr 2022 10:13:28 -0700	[thread overview]
Message-ID: <f3578cee-83a6-fe90-4268-8ae6d564e47b@suse.com> (raw)
In-Reply-To: <20220329180326.5586-5-michael.christie@oracle.com>

On 3/29/22 11:03, 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.
> 
> 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(-)
> 
> 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

Reviewed-by: Lee Duncan <lduncan@suse.com>


  reply	other threads:[~2022-04-01 17:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 18:03 [PATCH V3 00/15] misc iscsi patches Mike Christie
2022-03-29 18:03 ` [PATCH V3 01/15] scsi: iscsi: Move iscsi_ep_disconnect Mike Christie
2022-03-30 15:48   ` Lee Duncan
2022-04-01  9:17   ` wubo (T)
2022-03-29 18:03 ` [PATCH V3 02/15] scsi: iscsi: Fix offload conn cleanup when iscsid restarts Mike Christie
2022-03-31 18:04   ` Lee Duncan
2022-03-29 18:03 ` [PATCH V3 03/15] scsi: iscsi: Merge suspend fields Mike Christie
2022-04-01  9:29   ` wubo (T)
2022-03-29 18:03 ` [PATCH V3 04/15] scsi: iscsi: Fix nop handling during conn recovery Mike Christie
2022-04-01 17:13   ` Lee Duncan [this message]
2022-03-29 18:03 ` [PATCH V3 05/15] scsi: iscsi: Rename iscsi_conn_queue_work Mike Christie
2022-03-29 18:03 ` [PATCH V3 06/15] scsi: iscsi: Add recv workqueue helpers Mike Christie
2022-03-29 18:03 ` [PATCH V3 07/15] scsi: iscsi: Allow a recv and xmit work to run Mike Christie
2022-03-29 18:03 ` [PATCH V3 08/15] scsi: iscsi: Run recv path from workqueue Mike Christie
2022-03-29 18:03 ` [PATCH V3 09/15] scsi: iscsi_tcp: Tell net when there's more data Mike Christie
2022-03-29 18:03 ` [PATCH V3 10/15] scsi: iscsi_tcp: Drop target_alloc use Mike Christie
2022-03-29 18:03 ` [PATCH V3 11/15] scsi: iscsi: remove unneeded task state check Mike Christie
2022-03-29 18:03 ` [PATCH V3 12/15] scsi: iscsi: Remove iscsi_get_task back_lock requirement Mike Christie
2022-03-29 18:03 ` [PATCH V3 13/15] scsi: iscsi: Try to avoid taking back_lock in xmit path Mike Christie
2022-03-29 18:03 ` [PATCH V3 14/15] scsi: libiscsi: improve conn_send_pdu API Mike Christie
2022-03-29 18:03 ` [PATCH V3 15/15] scsi: iscsi: Fix race between recovery and task xmit Mike Christie
2022-04-02 21:36 ` [PATCH V3 00/15] misc iscsi patches Mike Christie

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=f3578cee-83a6-fe90-4268-8ae6d564e47b@suse.com \
    --to=lduncan@suse.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=cleech@redhat.com \
    --cc=jejb@linux.ibm.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 \
    /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 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.