diff mbox

[1/1] IB/iser: Protect completion context active_qps update

Message ID 1485993318-21372-1-git-send-email-maxg@mellanox.com (mailing list archive)
State Accepted
Headers show

Commit Message

Max Gurtovoy Feb. 1, 2017, 11:55 p.m. UTC
As iser connections can share completion contexts, we need
to protect the active_qps update each time we set it.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
---

Sagi,
this one was your commit that somehow slip out submission.

---
 drivers/infiniband/ulp/iser/iser_verbs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sagi Grimberg Feb. 8, 2017, 10:18 a.m. UTC | #1
Looks good,

Acked-by: Sagi Grimberg <sagi@grimberg.me>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford Feb. 19, 2017, 1:19 p.m. UTC | #2
On Wed, 2017-02-08 at 12:18 +0200, Sagi Grimberg wrote:
> Looks good,
> 
> Acked-by: Sagi Grimberg <sagi@grimberg.me>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index a4b791d..37fa0e7 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -597,7 +597,9 @@  static void iser_free_ib_conn_res(struct iser_conn *iser_conn,
 		  iser_conn, ib_conn->cma_id, ib_conn->qp);
 
 	if (ib_conn->qp != NULL) {
+		mutex_lock(&ig.connlist_mutex);
 		ib_conn->comp->active_qps--;
+		mutex_unlock(&ig.connlist_mutex);
 		rdma_destroy_qp(ib_conn->cma_id);
 		ib_conn->qp = NULL;
 	}