aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel Nahum <arieln@mellanox.com>2015-01-18 09:51:07 -0500
committerRoland Dreier <roland@purestorage.com>2015-02-17 15:33:14 -0500
commit9a3119e4b787d8c855202eb0388b213f86f88714 (patch)
treef3bdbad5eb0031dae9a31472f2e97c0aba0428a7
parent6606e6a2ff2710b473838b291dc533cd8fc1471f (diff)
IB/iser: Release the iscsi endpoint if ep_disconnect wasn't called
In some cases, we might reach the iser connection termination without ep_disconnect being invoked (for example if user-space daemon doesn't exists. In this case, we need to free the iscsi endpoint when we remove the iser connection. Signed-off-by: Ariel Nahum <arieln@mellanox.com> Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index f3e21abc20a6..4065abe28829 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -646,9 +646,11 @@ void iser_conn_release(struct iser_conn *iser_conn)
646 mutex_unlock(&ig.connlist_mutex); 646 mutex_unlock(&ig.connlist_mutex);
647 647
648 mutex_lock(&iser_conn->state_mutex); 648 mutex_lock(&iser_conn->state_mutex);
649 /* In case we endup here without ep_disconnect being invoked. */
649 if (iser_conn->state != ISER_CONN_DOWN) { 650 if (iser_conn->state != ISER_CONN_DOWN) {
650 iser_warn("iser conn %p state %d, expected state down.\n", 651 iser_warn("iser conn %p state %d, expected state down.\n",
651 iser_conn, iser_conn->state); 652 iser_conn, iser_conn->state);
653 iscsi_destroy_endpoint(iser_conn->ep);
652 iser_conn->state = ISER_CONN_DOWN; 654 iser_conn->state = ISER_CONN_DOWN;
653 } 655 }
654 /* 656 /*