All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: lduncan@suse.com, martin.petersen@oracle.com,
	rbharath@google.com, krisman@collabora.com,
	linux-scsi@vger.kernel.org, jejb@linux.ibm.com
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [RFC 6/7] scsi: iscsi: remove conn_mutex
Date: Sun, 11 Apr 2021 02:55:44 -0500	[thread overview]
Message-ID: <20210411075545.27866-7-michael.christie@oracle.com> (raw)
In-Reply-To: <20210411075545.27866-1-michael.christie@oracle.com>

We don't need the conn mutex now because conn stop and ep_disconnect wait
for kernel conn_stop/ep_disconnects.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
 drivers/scsi/scsi_transport_iscsi.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index da9fce1dceeb..ed69449166ae 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1619,12 +1619,6 @@ static DECLARE_TRANSPORT_CLASS(iscsi_connection_class,
 static struct sock *nls;
 static DEFINE_MUTEX(rx_queue_mutex);
 
-/*
- * conn_mutex protects the {start,bind,stop,destroy}_conn from racing
- * against the kernel stop_connection recovery mechanism
- */
-static DEFINE_MUTEX(conn_mutex);
-
 static LIST_HEAD(sesslist);
 static DEFINE_SPINLOCK(sesslock);
 static LIST_HEAD(connlist);
@@ -2886,11 +2880,8 @@ iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev
 
 	ISCSI_DBG_TRANS_CONN(conn, "Destroying transport conn\n");
 
-	mutex_lock(&conn_mutex);
 	if (transport->destroy_conn)
 		transport->destroy_conn(conn);
-	mutex_unlock(&conn_mutex);
-
 	return 0;
 }
 
@@ -3773,13 +3764,11 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
 			break;
 		}
 
-		mutex_lock(&conn_mutex);
 		ev->r.retcode =	transport->bind_conn(session, conn,
 						ev->u.b_conn.transport_eph,
 						ev->u.b_conn.is_leading);
 		if (!ev->r.retcode)
 			conn->state = ISCSI_CONN_BOUND;
-		mutex_unlock(&conn_mutex);
 
 		if (ev->r.retcode || !transport->ep_connect)
 			break;
@@ -3802,11 +3791,9 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
 	case ISCSI_UEVENT_START_CONN:
 		conn = iscsi_conn_lookup(ev->u.start_conn.sid, ev->u.start_conn.cid);
 		if (conn) {
-			mutex_lock(&conn_mutex);
 			ev->r.retcode = transport->start_conn(conn);
 			if (!ev->r.retcode)
 				conn->state = ISCSI_CONN_UP;
-			mutex_unlock(&conn_mutex);
 		}
 		else
 			err = -EINVAL;
@@ -3829,14 +3816,11 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
 
 		conn = iscsi_conn_lookup(ev->u.send_pdu.sid, ev->u.send_pdu.cid);
 		if (conn) {
-			mutex_lock(&conn_mutex);
 			ev->r.retcode =	transport->send_pdu(conn,
 				(struct iscsi_hdr*)((char*)ev + sizeof(*ev)),
 				(char*)ev + sizeof(*ev) + ev->u.send_pdu.hdr_size,
 				ev->u.send_pdu.data_size);
-			mutex_unlock(&conn_mutex);
-		}
-		else
+		} else
 			err = -EINVAL;
 		break;
 	case ISCSI_UEVENT_GET_STATS:
-- 
2.25.1


  parent reply	other threads:[~2021-04-11  7:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11  7:55 [RFC 0/7] iscsi: Fix in kernel conn failure handling Mike Christie
2021-04-11  7:55 ` [RFC 1/7] scsi: iscsi: fix iscsi cls conn state Mike Christie
2021-04-11  7:55 ` [RFC 2/7] scsi: iscsi: force immediate failure during shutdown Mike Christie
2021-04-11  7:55 ` [RFC 3/7] scsi: iscsi: make iscsi_eh_timer wq generic Mike Christie
2021-04-11  7:55 ` [RFC 4/7] scsi: iscsi: have callers do the put on iscsi_lookup_endpoint Mike Christie
2021-04-11  7:55 ` [RFC 5/7] scsi: iscsi: fix some of the bugs with Perform connection failure entirely in kernel space Mike Christie
2021-04-11  7:55 ` Mike Christie [this message]
2021-04-11  7:55 ` [RFC 7/7] scsi: iscsi_tcp: set no linger Mike Christie
2021-04-11  8:29   ` Mike Christie
2021-04-11 17:44 ` [RFC 0/7] iscsi: Fix in kernel conn failure handling 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=20210411075545.27866-7-michael.christie@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=jejb@linux.ibm.com \
    --cc=krisman@collabora.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=rbharath@google.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.