aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2016-11-06 04:09:49 -0500
committerSagi Grimberg <sagi@grimberg.me>2016-11-13 19:08:52 -0500
commit766dbb179d41d6337fed2b3ca00caa5845d298ce (patch)
treeeeebfbc27fd93915d79c47d686f0d442ea72823c
parent8242ddac1bfcf6eb8873b4d0a4e7a172c2b5b625 (diff)
nvmet-rdma: don't forget to delete a queue from the list of connection failed
In case we accepted a queue connection and it failed, we might not remove the queue from the list until we unload and clean it up. We should delete it from the queue list on the relevant handler. Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
-rw-r--r--drivers/nvme/target/rdma.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index cf60759cc169..8c06675c2305 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1066,6 +1066,7 @@ nvmet_rdma_alloc_queue(struct nvmet_rdma_device *ndev,
1066 spin_lock_init(&queue->rsp_wr_wait_lock); 1066 spin_lock_init(&queue->rsp_wr_wait_lock);
1067 INIT_LIST_HEAD(&queue->free_rsps); 1067 INIT_LIST_HEAD(&queue->free_rsps);
1068 spin_lock_init(&queue->rsps_lock); 1068 spin_lock_init(&queue->rsps_lock);
1069 INIT_LIST_HEAD(&queue->queue_list);
1069 1070
1070 queue->idx = ida_simple_get(&nvmet_rdma_queue_ida, 0, 0, GFP_KERNEL); 1071 queue->idx = ida_simple_get(&nvmet_rdma_queue_ida, 0, 0, GFP_KERNEL);
1071 if (queue->idx < 0) { 1072 if (queue->idx < 0) {
@@ -1269,7 +1270,12 @@ static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
1269{ 1270{
1270 WARN_ON_ONCE(queue->state != NVMET_RDMA_Q_CONNECTING); 1271 WARN_ON_ONCE(queue->state != NVMET_RDMA_Q_CONNECTING);
1271 1272
1272 pr_err("failed to connect queue\n"); 1273 mutex_lock(&nvmet_rdma_queue_mutex);
1274 if (!list_empty(&queue->queue_list))
1275 list_del_init(&queue->queue_list);
1276 mutex_unlock(&nvmet_rdma_queue_mutex);
1277
1278 pr_err("failed to connect queue %d\n", queue->idx);
1273 schedule_work(&queue->release_work); 1279 schedule_work(&queue->release_work);
1274} 1280}
1275 1281