From: Max Gurtovoy Date: Wed, 1 Feb 2017 23:55:18 +0000 (+0200) Subject: IB/iser: Protect completion context active_qps update X-Git-Tag: v4.11-rc1~103^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32f8e839edebe3310dd077439ce0e9a96e0c2352;p=platform%2Fkernel%2Flinux-exynos.git IB/iser: Protect completion context active_qps update 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 Acked-by: Sagi Grimberg Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 6a9d1cb..30b622f 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; }