lkml.org 
[lkml]   [2022]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6] scsi:iscsi: Fix multiple iscsi session unbind event sent to userspace
On Wed, Nov 23, 2022 at 1:04 AM Mike Christie
<michael.christie@oracle.com> wrote:
>
> On 11/21/22 8:17 AM, Wenchao Hao wrote:
> > And the function looks like following after change:
> >
> > static void __iscsi_unbind_session(struct work_struct *work)
> > {
> > struct iscsi_cls_session *session =
> > container_of(work, struct iscsi_cls_session,
> > unbind_work);
> > struct Scsi_Host *shost = iscsi_session_to_shost(session);
> > struct iscsi_cls_host *ihost = shost->shost_data;
> > unsigned long flags;
> > unsigned int target_id;
> >
> > ISCSI_DBG_TRANS_SESSION(session, "Unbinding session\n");
> >
> > /* Prevent new scans and make sure scanning is not in progress */
> > mutex_lock(&ihost->mutex);
> > spin_lock_irqsave(&session->lock, flags);
> > if (session->target_state != ISCSI_SESSION_TARGET_SCANNED) {
>
> What was the reason for not checking for ALLOCATED and freeing the ida
> in that case?
>

target_state would be in "ALLOCATED" state if iscsid died after add
session successfully.
When iscsid restarted, if the session's target_state is "ALLOCATED",
it should scan
the session and the target_state would switch to "SCANNED".

So I think we would not call in __iscsi_unbind_session() with
session's target_state
is ALLOCATED.

\
 
 \ /
  Last update: 2022-11-22 18:30    [W:0.093 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site