Skip to contentSkip to conversation

nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH

PATCH In review Christoph Hellwig 2 participants 4 messages Mar 15, 2022 – Mar 16, 2022

Subsystems (2)
lore
Share & tools
lore

Christoph Hellwig

author maintainer
#0 lore raw

PATCH 1/1 nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH

Start warning about exposing a namespace as multiple block devices, and set a fixed deprecation release.

---
 drivers/block/loop.c     | 1 +
 drivers/nvme/host/core.c | 8 ++++++++
 2 files changed, 9 insertions(+)
drivers/block/loop.c +1 -0
index 8fb89d0624fc5..e733c48de2e90 100644
@@ -2092,6 +2092,7 @@ static void loop_remove(struct loop_device *lo)
 	del_gendisk(lo->lo_disk);
 	blk_cleanup_disk(lo->lo_disk);
 	blk_mq_free_tag_set(&lo->tag_set);
+
 	mutex_lock(&loop_ctl_mutex);
 	idr_remove(&loop_index_idr, lo->lo_number);
 	mutex_unlock(&loop_ctl_mutex);
drivers/nvme/host/core.c +8 -0
index fd9878671d734..75f7c53a67811 100644
@@ -3879,6 +3879,14 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
 					nsid);
 			goto out_put_ns_head;
 		}
+
+		if (!multipath && !list_empty(&head->list)) {
+			dev_warn(ctrl->device,
+				"Found shared namespace %d, but multipathing not supported.\n",
+				nsid);
+			dev_warn_once(ctrl->device,
+				"Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0\n.");
+		}
 	}
 
 	list_add_tail_rcu(&ns->siblings, &head->list);
Signature · 1 line
2.30.2
maintainer
#1 lore raw

drivers/block/loop.c static void loop_remove(struct loop_device *lo) · line 2098

Quoted 12 lines · Christoph Hellwig
drivers/block/loop.c +1 -0
index 8fb89d0624fc5..e733c48de2e90 100644
@@ -2092,6 +2092,7 @@ static void loop_remove(struct loop_device *lo)
 	del_gendisk(lo->lo_disk);
 	blk_cleanup_disk(lo->lo_disk);
 	blk_mq_free_tag_set(&lo->tag_set);
+
 	mutex_lock(&loop_ctl_mutex);
 	idr_remove(&loop_index_idr, lo->lo_number);
 	mutex_unlock(&loop_ctl_mutex);

This unrelated change sneaked into your patch. :)

Quoted 6 lines
drivers/nvme/host/core.c +0 -0
index fd9878671d734..75f7c53a67811 100644
@@ -3879,6 +3879,14 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
 					nsid);

drivers/nvme/host/core.c static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid, · line 3889

Quoted 10 lines
drivers/nvme/host/core.c +8 -0
 			goto out_put_ns_head;
 		}
+
+		if (!multipath && !list_empty(&head->list)) {
+			dev_warn(ctrl->device,
+				"Found shared namespace %d, but multipathing not supported.\n",
+				nsid);
+			dev_warn_once(ctrl->device,
+				"Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0\n.");
+		}

The recent release pattern suggests 5.20 will be the last of the 5.x tags before seeing 6.0, but my understanding is that's at the discretion of Chief Penguin. Unless you know already, perhaps warning with 5.21 is more clear that removing this capability happens after 3 more releases.

author maintainer
#2 lore raw
Quoted 15 lines · Keith Busch

drivers/block/loop.c static void loop_remove(struct loop_device *lo) · line 2098

Quoted 12 lines · Christoph Hellwig
drivers/block/loop.c +1 -0
index 8fb89d0624fc5..e733c48de2e90 100644
@@ -2092,6 +2092,7 @@ static void loop_remove(struct loop_device *lo)
 	del_gendisk(lo->lo_disk);
 	blk_cleanup_disk(lo->lo_disk);
 	blk_mq_free_tag_set(&lo->tag_set);
+
 	mutex_lock(&loop_ctl_mutex);
 	idr_remove(&loop_index_idr, lo->lo_number);
 	mutex_unlock(&loop_ctl_mutex);

This unrelated change sneaked into your patch. :)

Ooops.

Quoted 4 lines

The recent release pattern suggests 5.20 will be the last of the 5.x tags before seeing 6.0, but my understanding is that's at the discretion of Chief Penguin. Unless you know already, perhaps warning with 5.21 is more clear that removing this capability happens after 3 more releases.

Sounds good to me - we are not in a crazy urge right now, but we need to settle this eventually.