Skip to contentSkip to conversation

nvme-rdma: only clear queue flags after successful connect

PATCH New Sagi Grimberg 4 participants 4 messages Sep 21, 2016 – Sep 23, 2016 NVMe

lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 nvme-rdma: only clear queue flags after successful connect

Otherwise, nvme_rdma_stop_and_clear_queue() will incorrectly try to stop/free rdma qps/cm_ids that are already freed.

Fixes e89ca58f9c90 ("nvme-rdma: add DELETING queue flag")
Reported-by Steve Wise <swise at opengridcomputing.com>
Tested-by Steve Wise <swise at opengridcomputing.com>
Signed-off-by Sagi Grimberg <sagi at grimberg.me>

---
Jens, care to pick this last minute fix for rc8? Thanks

 drivers/nvme/host/rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/rdma.c +1 -1
index c2c2c28e6eb5..fbdb2267e460 100644
@@ -561,7 +561,6 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl,
 
 	queue = &ctrl->queues[idx];
 	queue->ctrl = ctrl;
-	queue->flags = 0;
 	init_completion(&queue->cm_done);
 
 	if (idx > 0)
@@ -595,6 +594,7 @@ static int nvme_rdma_init_queue(struct nvme_rdma_ctrl *ctrl,
 		goto out_destroy_cm_id;
 	}
 
+	clear_bit(NVME_RDMA_Q_DELETING, &queue->flags);
 	set_bit(NVME_RDMA_Q_CONNECTED, &queue->flags);
 
 	return 0;
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 nvme-rdma: only clear queue flags after successful connect

Allright, looks fine now:

Reviewed-by Christoph Hellwig <hch at lst.de>
#2 lore raw

PATCH 1/1 nvme-rdma: only clear queue flags after successful connect

In reply to Sagi Grimberg
Quoted 9 lines

Otherwise, nvme_rdma_stop_and_clear_queue() will incorrectly try to stop/free rdma qps/cm_ids that are already freed.

Fixes e89ca58f9c90 ("nvme-rdma: add DELETING queue flag")
Reported-by Steve Wise <swise at opengridcomputing.com>
Tested-by Steve Wise <swise at opengridcomputing.com>
Signed-off-by Sagi Grimberg <sagi at grimberg.me>

---
Jens, care to pick this last minute fix for rc8?

It would be great to get this rc8 to avoid the crash on reconnect timeouts...

Steve.

maintainer
#3 lore raw

PATCH 1/1 nvme-rdma: only clear queue flags after successful connect

Quoted 10 lines · Steve Wise
Quoted 9 lines

Otherwise, nvme_rdma_stop_and_clear_queue() will incorrectly try to stop/free rdma qps/cm_ids that are already freed.

Fixes e89ca58f9c90 ("nvme-rdma: add DELETING queue flag")
Reported-by Steve Wise <swise at opengridcomputing.com>
Tested-by Steve Wise <swise at opengridcomputing.com>
Signed-off-by Sagi Grimberg <sagi at grimberg.me>

---
Jens, care to pick this last minute fix for rc8?

Quoted 2 lines

It would be great to get this rc8 to avoid the crash on reconnect timeouts...

Added, I'll push out the last fixes tomorrow for 4.8, thanks.

Signature · 1 line
Jens Axboe