Skip to contentSkip to conversation

nvme-fc: fix error loop in create_hw_io_queues

PATCH Applied James Smart 4 participants 4 messages Oct 16, 2020 – Oct 22, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-fc: fix error loop in create_hw_io_queues

The loop that backs out of hw io queue creation continues through index 0, which corresponds to the admin queue as well.

Fix the loop so it only proceeds through indexes 1..n which correspond to io queues.

---
 drivers/nvme/host/fc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +1 -1
index e2e09e25c056..f002522146e2 100644
@@ -2314,7 +2314,7 @@ nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
 	return 0;
 
 delete_queues:
-	for (; i >= 0; i--)
+	for (; i > 0; i--)
 		__nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i);
 	return ret;
 }
Signature · 1 line
2.26.2

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · James Smart

The loop that backs out of hw io queue creation continues through index 0, which corresponds to the admin queue as well.

Fix the loop so it only proceeds through indexes 1..n which correspond to io queues.

---
  drivers/nvme/host/fc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +0 -0
index e2e09e25c056..f002522146e2 100644

drivers/nvme/host/fc.c nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) · line 2320

Quoted 8 lines
drivers/nvme/host/fc.c +1 -1
@@ -2314,7 +2314,7 @@ nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
  	return 0;
 
  delete_queues:
-	for (; i >= 0; i--)
+	for (; i > 0; i--)
  		__nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i);
  	return ret;
  }

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke                Kernel Storage Architect
[email protected]                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#2 lore raw
In reply to James Smart
Quoted 25 lines · James Smart

The loop that backs out of hw io queue creation continues through index 0, which corresponds to the admin queue as well.

Fix the loop so it only proceeds through indexes 1..n which correspond to io queues.

---
drivers/nvme/host/fc.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/fc.c +0 -0
index e2e09e25c056..f002522146e2 100644
@@ -2314,7 +2314,7 @@ nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize)
 	return 0;
 

delete_queues:

drivers/nvme/host/fc.c +1 -1
-	for (; i >= 0; i--)
+	for (; i > 0; i--)
Quoted 10 lines
		__nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i);
	return ret;
}
Signature · 6 lines
2.26.2

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

--
Himanshu Madhani Oracle Linux Engineering

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme