Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Wenchao Hao <haowenchao@huawei.com>,
	Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Steffen Maier <maier@linux.ibm.com>,
	liuzhiqiang26@huawei.com, linfeilong@huawei.com
Subject: Re: [PATCH v4] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace
Date: Fri, 21 Oct 2022 12:24:04 -0500	[thread overview]
Message-ID: <daa60cf0-0dde-ea2d-211a-70a9e0efc1b8@oracle.com> (raw)
In-Reply-To: <20221021235754.1968981-1-haowenchao@huawei.com>

On 10/21/22 6:57 PM, Wenchao Hao wrote:
> +
>  int iscsi_session_chkready(struct iscsi_cls_session *session)
>  {
>  	int err;
> @@ -1899,6 +1922,7 @@ static void __iscsi_unblock_session(struct work_struct *work)
>  	cancel_delayed_work_sync(&session->recovery_work);
>  	spin_lock_irqsave(&session->lock, flags);
>  	session->state = ISCSI_SESSION_LOGGED_IN;
> +	session->target_state = ISCSI_SESSION_TARGET_BOUND;
>  	spin_unlock_irqrestore(&session->lock, flags);
>  	/* start IO */

Hey,

Sorry for the late reply.

For the initial login we have not scanned the session above, so there
is no target yet. If iscsid is restarted at this time, then iscsid wants
to sync the session and also do the initial scan.

To handle that case and also better match the state names with the
session's target state we can:

1. Move the above line to iscsi_user_scan_session after we have scanned
the target.
2. Add a new state ISCSI_SESSION_TARGET_ALLOCATED to reflect we have
allocated the target_id, but not yet scanned.

  reply	other threads:[~2022-10-21 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 23:57 [PATCH v4] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace Wenchao Hao
2022-10-21 17:24 ` Mike Christie [this message]
2022-10-22  9:40   ` Wenchao Hao
2022-10-23  3:21     ` Mike Christie
2022-10-24 12:50       ` Wenchao Hao

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=daa60cf0-0dde-ea2d-211a-70a9e0efc1b8@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=cleech@redhat.com \
    --cc=haowenchao@huawei.com \
    --cc=jejb@linux.ibm.com \
    --cc=lduncan@suse.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    --cc=maier@linux.ibm.com \
    --cc=martin.petersen@oracle.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