From 9dee83d555ad68de81349907e97d2aff26379e64 Mon Sep 17 00:00:00 2001 From: Israel Rukshin Date: Wed, 17 Aug 2016 07:28:25 +0000 Subject: [PATCH] isert: faster release of isert_scst module If there is a dead connection we don't want to wait 60 seconds for the connection timeout error. So when closing the portal we close now all the connections immediately without waiting for events to arrive. Signed-off-by: Israel Rukshin git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6952 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 70d3e2aef..600b5182a 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1891,11 +1891,20 @@ void isert_portal_release(struct isert_portal *portal) isert_portal_list_remove(portal); mutex_lock(&dev_list_mutex); - list_for_each_entry(conn, &portal->conn_list, portal_node) + list_for_each_entry(conn, &portal->conn_list, portal_node) { isert_conn_disconnect(conn); + if (!test_and_set_bit(ISERT_CONNECTION_CLOSE, &conn->flags)) + isert_sched_conn_closed(conn); + } portal->state = ISERT_PORTAL_INACTIVE; isert_portal_free(portal); mutex_unlock(&dev_list_mutex); + + while (!list_empty(&portal->conn_list)) { + msleep(100); + } + + PRINT_INFO("done releasing portal %p", portal); } struct isert_portal *isert_portal_start(struct sockaddr *sa, size_t addr_len)