Commit d39bfd06 authored by Mike Christie's avatar Mike Christie Committed by Martin K. Petersen

scsi: iscsi: Drop session lock in iscsi_session_chkready()

The session lock in iscsi_session_chkready() is not needed because when we
transition from logged into to another state we will block and/or remove
the devices under the session, so no new I/O will be sent to the drivers
after the block/remove. I/O that races with the block/removal is cleaned up
by the drivers when it handles all outstanding I/O, so this just added an
extra lock in the main I/O path. This patch removes the lock like other
transport classes.

Link: https://lore.kernel.org/r/20210207044608.27585-10-michael.christie@oracle.comReviewed-by: default avatarLee Duncan <lduncan@suse.com>
Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5b0ec4cf
...@@ -1701,10 +1701,8 @@ static const char *iscsi_session_state_name(int state) ...@@ -1701,10 +1701,8 @@ static const char *iscsi_session_state_name(int state)
int iscsi_session_chkready(struct iscsi_cls_session *session) int iscsi_session_chkready(struct iscsi_cls_session *session)
{ {
unsigned long flags;
int err; int err;
spin_lock_irqsave(&session->lock, flags);
switch (session->state) { switch (session->state) {
case ISCSI_SESSION_LOGGED_IN: case ISCSI_SESSION_LOGGED_IN:
err = 0; err = 0;
...@@ -1719,7 +1717,6 @@ int iscsi_session_chkready(struct iscsi_cls_session *session) ...@@ -1719,7 +1717,6 @@ int iscsi_session_chkready(struct iscsi_cls_session *session)
err = DID_NO_CONNECT << 16; err = DID_NO_CONNECT << 16;
break; break;
} }
spin_unlock_irqrestore(&session->lock, flags);
return err; return err;
} }
EXPORT_SYMBOL_GPL(iscsi_session_chkready); EXPORT_SYMBOL_GPL(iscsi_session_chkready);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment