Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-rdma: fix crash for no IO queues
@ 2021-02-23  7:26 Chao Leng
  2021-02-23 22:03 ` Chaitanya Kulkarni
  2021-02-23 23:21 ` Keith Busch
  0 siblings, 2 replies; 15+ messages in thread
From: Chao Leng @ 2021-02-23  7:26 UTC (permalink / raw)
  To: linux-nvme; +Cc: kbusch, axboe, hch, sagi

A crash happens when set feature(NVME_FEAT_NUM_QUEUES) timeout in nvme
over rdma(roce) reconnection, the reason is use the queue which is not
alloced.

If it is not discovery and no io queues, the connection should fail.

Signed-off-by: Chao Leng <lengchao@huawei.com>
---
 drivers/nvme/host/rdma.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
index 53ac4d7442ba..7410972353ae 100644
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@ -736,8 +736,11 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl)
 		return ret;
 
 	ctrl->ctrl.queue_count = nr_io_queues + 1;
-	if (ctrl->ctrl.queue_count < 2)
-		return 0;
+	if (ctrl->ctrl.queue_count < 2) {
+		if (opts->discovery_nqn)
+			return 0;
+		return -EAGAIN;
+	}
 
 	dev_info(ctrl->ctrl.device,
 		"creating %d I/O queues.\n", nr_io_queues);
-- 
2.16.4


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

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

end of thread, other threads:[~2021-03-03 22:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-23  7:26 [PATCH] nvme-rdma: fix crash for no IO queues Chao Leng
2021-02-23 22:03 ` Chaitanya Kulkarni
2021-02-24  5:52   ` Chao Leng
2021-02-23 23:21 ` Keith Busch
2021-02-24  5:59   ` Chao Leng
2021-02-27  9:12     ` Hannes Reinecke
2021-02-27  9:30       ` Chao Leng
2021-03-02  7:48         ` Hannes Reinecke
2021-03-02  9:49           ` Chao Leng
2021-03-02 18:24             ` Keith Busch
2021-03-03  2:27               ` Chao Leng
2021-03-03  3:14                 ` Keith Busch
2021-03-03  3:39                   ` Chao Leng
2021-03-03  7:41                     ` Hannes Reinecke
2021-03-03 15:08                       ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox