lkml.org 
[lkml]   [2015]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] infiniband:core:Fix mutex locking to lock before unlocking in the function cma_ib_mc_handler
Date
> This fixes mutex locking to lock before unlocking in the function
> cma_ib_mc_handler for the mutex handler_mutex as part of the pointer
> id_priv before unlocking it after the critical region for event handler
> work and execution in order to have actual proper concurrent execution
> protection around this critical region in the function cma_ib_mc_handler.

The call cma_disable_callback() acquires the mutex.

> ---
> drivers/infiniband/core/cma.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 143ded2..7b89195 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -3158,6 +3158,7 @@ static int cma_ib_mc_handler(int status, struct
> ib_sa_multicast *multicast)
> } else
> event.event = RDMA_CM_EVENT_MULTICAST_ERROR;
>
> + mutex_lock(&id_priv->handler_mutex);

This mutex is already held at this point.

> ret = id_priv->id.event_handler(&id_priv->id, &event);
> if (ret) {
> cma_exch(id_priv, RDMA_CM_DESTROYING);
> --
> 2.1.4



\
 
 \ /
  Last update: 2015-09-08 19:01    [W:0.026 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site