linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] nvme-rdma: Queue ns scanning after a sucessful reconnection
@ 2016-07-31 15:55 Sagi Grimberg
       [not found] ` <1469980540-16103-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Sagi Grimberg @ 2016-07-31 15:55 UTC (permalink / raw)
  To: linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Jens Axboe, Christoph Hellwig, Keith Busch, Jay Freyensee,
	Ming Lin, Steve Wise

On an ordered target shutdown, the target can send a AEN on a namespace
removal, this will trigger the host to queue ns-list query. The shutdown
will trigger error recovery which will attepmt periodic reconnect.

We can hit a race where the ns rescanning fails (error recovery kicked
in and we're not connected) causing removing all the namespaces and when
we reconnect we won't see any namespaces for this controller.

So, queue a namespace rescan after we successfully reconnected to the target.

Note, that unlike user initiated controller reset, we don't need to trigger
namespace scanning (until the point I noticed the above at least) because we
reconnect to an existing controller. However due to the interaction with
the aen mechanism we queue ns scan here as well.

Signed-off-by: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
---
I'm open to other suggestions if anyone has any...

 drivers/nvme/host/rdma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index f8539dd75504..5cb069ab27ed 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -743,8 +743,10 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work)
 	changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
 	WARN_ON_ONCE(!changed);
 
-	if (ctrl->queue_count > 1)
+	if (ctrl->queue_count > 1) {
 		nvme_start_queues(&ctrl->ctrl);
+		nvme_queue_scan(&ctrl->ctrl);
+	}
 
 	dev_info(ctrl->ctrl.device, "Successfully reconnected\n");
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-08-08 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-31 15:55 [PATCH RFC] nvme-rdma: Queue ns scanning after a sucessful reconnection Sagi Grimberg
     [not found] ` <1469980540-16103-1-git-send-email-sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2016-08-01 11:14   ` Christoph Hellwig
2016-08-04 17:08   ` J Freyensee
     [not found]     ` <1470330508.19927.18.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-08-07  9:12       ` Sagi Grimberg
     [not found]         ` <ce424fe1-d6e8-706f-18f8-aa9c880bcdec-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2016-08-08 19:43           ` J Freyensee

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).