]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: fix memory leak during queue allocation
authorMax Gurtovoy <maxg@mellanox.com>
Tue, 28 Nov 2017 16:28:44 +0000 (18:28 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 28 Nov 2017 16:49:22 +0000 (08:49 -0800)
commitc4f49b345487cdb1e4c8f1b6adca99b17f1a00a4
tree520a3360446477d4e142447dd8afab8a2040700c
parentfd7d0c55989d0c858215a848d6bff3a11698fd7c
nvme-rdma: fix memory leak during queue allocation

In case nvme_rdma_wait_for_cm timeout expires before we get
an established or rejected event (rdma_connect succeeded) from
rdma_cm, we end up with leaking the ib transport resources for
dedicated queue. This scenario can easily reproduced using traffic
test during port toggling.
Also, in order to protect from parallel ib queue destruction, that
may be invoked from different context's, introduce new flag that
stands for transport readiness. While we're here, protect also against
a situation that we can receive rdma_cm events during ib queue destruction.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c