[bug report] blktests nvme/061 hang with rdma transport and siw driver

Shinichiro Kawasaki shinichiro.kawasaki at wdc.com
Sat May 10 03:04:42 PDT 2025


On May 08, 2025 / 07:03, Shinichiro Kawasaki wrote:
[...]
> diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
> index f4486cbd8f45..600cf8ea6a39 100644
> --- a/drivers/infiniband/core/iwcm.c
> +++ b/drivers/infiniband/core/iwcm.c
[...]
> @@ -442,20 +439,22 @@ static bool destroy_cm_id(struct iw_cm_id *cm_id)
>  		iwpm_remove_mapinfo(&cm_id->local_addr, &cm_id->m_local_addr);
>  		iwpm_remove_mapping(&cm_id->local_addr, RDMA_NL_IWCM);
>  	}
> -
> -	return iwcm_deref_id(cm_id_priv);
>  }
>  
>  /*
>   * This function is only called by the application thread and cannot
>   * be called by the event thread. The function will wait for all
> - * references to be released on the cm_id and then kfree the cm_id
> - * object.
> + * references to be released on the cm_id and then release the initial
> + * reference taken by iw_create_cm_id.
>   */
>  void iw_destroy_cm_id(struct iw_cm_id *cm_id)
>  {
> -	if (!destroy_cm_id(cm_id))
> -		flush_workqueue(iwcm_wq);

While I evalute this fix patch, I notcied that the if statement above should be
left. Or, srp tests with the siw drivers hang.

> +	struct iwcm_id_private *cm_id_priv;
> +
> +	cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
> +	destroy_cm_id(cm_id);
> +	flush_workqueue(iwcm_wq);

To keep the if statement above, I modified the line above as folllows,
then the srp tests passed.

       if (refcount_read(&cm_id_priv->refcount) > 1)
                flush_workqueue(iwcm_wq);

Will post the formal patch with this modification.

> +	iwcm_deref_id(cm_id_priv);
>  }
>  EXPORT_SYMBOL(iw_destroy_cm_id);


More information about the Linux-nvme mailing list