> @@ -2570,9 +2557,12 @@ static int cma_ib_mc_handler(int status,
> int ret;
>
> id_priv = mc->id_priv;
> - if (cma_disable_remove(id_priv, CMA_ADDR_BOUND) &&
> - cma_disable_remove(id_priv, CMA_ADDR_RESOLVED))
> + mutex_lock(&id_priv->handler_mutex);
> + if ((id_priv->state != CMA_ADDR_BOUND) &&
> + (id_priv->state != CMA_ADDR_RESOLVED)) {
> + mutex_unlock(&id_priv->handler_mutex);
> return 0;
> + }
why don't you just do
if (cma_disable_callback(id_priv, CMA_ADDR_BOUND) &&
cma_disable_callback(id_priv, CMA_ADDR_RESOLVED))
instead of open-coding here? (&& is specified to have short-circuit
semantics, so if the first call takes the mutex, the second call won't
be made)
It seems your change is a subtle change in semantics and breaks the
encapsulation of this callback disabling here.
- R.
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general