Skip to contentSkip to conversation

nvme: parse partition table when registering a block device

PATCH Applied Denis Orlov 2 participants 2 messages Feb 9, 2023 – Feb 10, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: parse partition table when registering a block device

Otherwise, we can not access file systems located on partitioned NVME drives.

---
 drivers/nvme/host/core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/nvme/host/core.c +5 -0
index 79a5f9325e..bf9176ce09 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <common.h>
+#include <disks.h>
 
 #include "nvme.h"
 
@@ -372,6 +373,10 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
 		goto out_free_id;
 	}
 
+	ret = parse_partition_table(&ns->blk);
+	if (ret)
+		dev_warn(ctrl->dev, "No partition table found\n");
+
 	return;
 out_free_id:
 	kfree(id);
Signature · 1 line
2.30.2
Applied
#1 lore raw
Quoted 7 lines · Denis Orlov

Otherwise, we can not access file systems located on partitioned NVME drives.

---
 drivers/nvme/host/core.c | 5 +++++
 1 file changed, 5 insertions(+)

Applied, thanks

Sascha

Quoted 27 lines
drivers/nvme/host/core.c +5 -0
index 79a5f9325e..bf9176ce09 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <common.h>
+#include <disks.h>
 
 #include "nvme.h"
 
@@ -372,6 +373,10 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
 		goto out_free_id;
 	}
 
+	ret = parse_partition_table(&ns->blk);
+	if (ret)
+		dev_warn(ctrl->dev, "No partition table found\n");
+
 	return;
 out_free_id:
 	kfree(id);
Signature · 1 line
2.30.2
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |