[SRU][Bionic][PATCH 2/2] nvme-rdma: Don't flush delete_wq by default during remove_one
Joseph Salisbury
joseph.salisbury at canonical.com
Mon May 7 21:33:01 UTC 2018
From: Max Gurtovoy <maxg at mellanox.com>
BugLink: http://bugs.launchpad.net/bugs/1764982
The .remove_one function is called for any ib_device removal.
In case the removed device has no reference in our driver, there
is no need to flush the work queue.
Reviewed-by: Israel Rukshin <israelr at mellanox.com>
Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
Signed-off-by: Keith Busch <keith.busch at intel.com>
Signed-off-by: Jens Axboe <axboe at kernel.dk>
(cherry picked from commit 9bad0404ecd7594265cef04e176adeaa4ffbca4a)
Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
---
drivers/nvme/host/rdma.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 2a0bba7..65cfa6c 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -2027,6 +2027,20 @@ static struct nvmf_transport_ops nvme_rdma_transport = {
static void nvme_rdma_remove_one(struct ib_device *ib_device, void *client_data)
{
struct nvme_rdma_ctrl *ctrl;
+ struct nvme_rdma_device *ndev;
+ bool found = false;
+
+ mutex_lock(&device_list_mutex);
+ list_for_each_entry(ndev, &device_list, entry) {
+ if (ndev->dev == ib_device) {
+ found = true;
+ break;
+ }
+ }
+ mutex_unlock(&device_list_mutex);
+
+ if (!found)
+ return;
/* Delete all controllers using this device */
mutex_lock(&nvme_rdma_ctrl_mutex);
--
2.7.4
More information about the kernel-team
mailing list