Skip to contentSkip to conversation

nvme-core : remove redundant check from nvme_init_ns_head

PATCH Applied Irvin Cote 4 participants 6 messages May 17, 2023 – May 20, 2023 NVMe

lore
Share & tools
lore

Irvin Cote

author
#0 lore raw

PATCH 1/1 nvme-core : remove redundant check from nvme_init_ns_head

nvme_find_ns_head already checks that the list of namescpaces in an already existing namespace head is not empty

---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index ccb6eb1282f8..54a8eadd9876 100644
@@ -4209,7 +4209,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
 			goto out_put_ns_head;
 		}
 
-		if (!multipath && !list_empty(&head->list)) {
+		if (!multipath) {
 			dev_warn(ctrl->device,
 				"Found shared namespace %d, but multipathing not supported.\n",
 				info->nsid);
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines

nvme_find_ns_head already checks that the list of namescpaces in an already existing namespace head is not empty

---
  drivers/nvme/host/core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +0 -0
index ccb6eb1282f8..54a8eadd9876 100644

drivers/nvme/host/core.c static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info) · line 4215

Quoted 8 lines
drivers/nvme/host/core.c +1 -1
@@ -4209,7 +4209,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
  			goto out_put_ns_head;
  		}
 
-		if (!multipath && !list_empty(&head->list)) {
+		if (!multipath) {
  			dev_warn(ctrl->device,
  				"Found shared namespace %d, but multipathing not supported.\n",
  				info->nsid);
maintainer Applied
#2 lore raw
In reply to Irvin Cote

drivers/nvme/host/core.c static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info) · line 4215

Quoted 6 lines · Irvin Cote
drivers/nvme/host/core.c +1 -1
-		if (!multipath && !list_empty(&head->list)) {
+		if (!multipath) {
 			dev_warn(ctrl->device,
 				"Found shared namespace %d, but multipathing not supported.\n",
 				info->nsid);

Thanks, applied for nvme-6.5.

Side note, the very next print says this path was to be removed by 6.0, so we're a little late on that. Did you actually hit this condition or found it from inspection?

author
#3 lore raw

I found it from inspection

Quoted 14 lines · Keith Busch

drivers/nvme/host/core.c static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)

Quoted 6 lines · Irvin Cote
drivers/nvme/host/core.c +1 -2
-             if (!multipath && !list_empty(&head->list)) {
+             if (!multipath) {
                      dev_warn(ctrl->device,
                              "Found shared namespace %d, but multipathing not supported.\n",
                              info->nsid);
--

Thanks, applied for nvme-6.5.

Side note, the very next print says this path was to be removed by 6.0, so we're a little late on that. Did you actually hit this condition or found it from inspection?

#4 lore raw
In reply to Keith Busch
Quoted 10 lines · Keith Busch

drivers/nvme/host/core.c static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info) · line 4215

Quoted 6 lines · Irvin Cote
drivers/nvme/host/core.c +1 -1
-		if (!multipath && !list_empty(&head->list)) {
+		if (!multipath) {
 			dev_warn(ctrl->device,
 				"Found shared namespace %d, but multipathing not supported.\n",
 				info->nsid);

Thanks, applied for nvme-6.5.

Quoted 2 lines

Side note, the very next print says this path was to be removed by 6.0, so we're a little late on that.

Yeah, I need to get to this and the resulting cleanup. Hopefully I'll find some time the next weeks.