[PATCH WIP/RFC 4/6] nvme-rdma: destroy nvme queue rdma resources on connect failure

Christoph Hellwig hch at lst.de
Fri Aug 26 07:39:52 PDT 2016


On Fri, Aug 26, 2016 at 06:50:58AM -0700, Steve Wise wrote:
> After address resolution, the nvme_rdma_queue rdma resources are
> allocated.  If rdma route resolution or the connect fails, or the
> controller reconnect times out and gives up, then the rdma resources
> need to be freed.  Otherwise, rdma resources are leaked.

I'm pretty sure Sagi tried to convince me we'd need something like this
begfore and I tried to resists.  Sorry guys..

>  struct nvme_rdma_queue {
> @@ -488,6 +489,7 @@ static void nvme_rdma_destroy_queue_ib(struct nvme_rdma_queue *queue)
>  	struct nvme_rdma_device *dev = queue->device;
>  	struct ib_device *ibdev = dev->dev;
>  
> +	clear_bit(NVME_RDMA_IB_QUEUE_ALLOCATED, &queue->flags);

How about doing a

	if (!test_and_clear(NVME_RDMA_IB_QUEUE_ALLOCATED, &queue->flags))
		return;

here so the the callers don't have to worry?

Otherwise this looks fine to me.



More information about the Linux-nvme mailing list