Re: [PATCH] RDMA/cma: Fix listener leak in rdma_cma_listen_on_all() failure

From: Jason Gunthorpe
Date: Wed Sep 15 2021 - 09:18:51 EST


On Wed, Sep 15, 2021 at 02:34:19PM +0800, Mark Zhang wrote:
> > - case RDMA_CM_LISTEN:
> > - if (cma_any_addr(cma_src_addr(id_priv)) && !id_priv->cma_dev)
> > - cma_cancel_listens(id_priv);
> > - break;
>
> If this case is removed, is this code path still good?
>
> cma_add_one/cma_remove_one
> cma_process_remove
> cma_send_device_removal_put
> cma_cancel_operation

Yes, it is complicated, but the cma_process_remove() won't proceed
past cma_dev_put() until all the ULPs have gone through _destroy_id()

So all this does is move the reaping of the listens to the destroy_id
time

Jason