All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] nvmet-rdma: don't forget to delete a queue from the list of connection failed
@ 2016-11-06 17:30 Sagi Grimberg
  2016-11-06 19:29 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Sagi Grimberg @ 2016-11-06 17:30 UTC (permalink / raw)


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 at grimberg.me>
---
Changes from v1:
- changed strategy according to hch's comments. remove the queue
  on connection failure handlers.
- chaged the commit description (was "nvmet-rdma: add queue to queue list only
  if connection established")

 drivers/nvme/target/rdma.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index bafd9898b5f6..a9eb677d562a 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1272,7 +1272,12 @@ static void nvmet_rdma_queue_connect_fail(struct rdma_cm_id *cm_id,
 {
 	WARN_ON_ONCE(queue->state != NVMET_RDMA_Q_CONNECTING);
 
-	pr_err("failed to connect queue\n");
+	mutex_lock(&nvmet_rdma_queue_mutex);
+	if (!list_empty(&queue->queue_list))
+		list_del_init(&queue->queue_list);
+	mutex_unlock(&nvmet_rdma_queue_mutex);
+
+	pr_err("failed to connect queue %d\n", queue->idx);
 	schedule_work(&queue->release_work);
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-06 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-06 17:30 [PATCH v1] nvmet-rdma: don't forget to delete a queue from the list of connection failed Sagi Grimberg
2016-11-06 19:29 ` Christoph Hellwig
2016-11-06 21:33   ` Sagi Grimberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.