linux-nvme.lists.infradead.org archive mirror
 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

* [PATCH v1] nvmet-rdma: don't forget to delete a queue from the list of connection failed
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2016-11-06 19:29 UTC (permalink / raw)


On Sun, Nov 06, 2016@07:30:48PM +0200, Sagi Grimberg wrote:
> 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.

I think for this to work we'll also need to initialize
->queue_list when allocating the queue.

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

* [PATCH v1] nvmet-rdma: don't forget to delete a queue from the list of connection failed
  2016-11-06 19:29 ` Christoph Hellwig
@ 2016-11-06 21:33   ` Sagi Grimberg
  0 siblings, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2016-11-06 21:33 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.
>
> I think for this to work we'll also need to initialize
> ->queue_list when allocating the queue.

Not really because we'll only manipulate the queue_list if we accept
which means that it's in the list, nvmet_rdma_queue_connect() failures
won't ever see nvmet_rdma_queue_connect_fail(). But I can add it for
good measures...

^ permalink raw reply	[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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).