nvme-core: use nvme_ns_head_multipath instead of ns->head->disk
authorIrvin Cote <irvincoteg@gmail.com>
Thu, 18 May 2023 22:10:54 +0000 (19:10 -0300)
committerKeith Busch <kbusch@kernel.org>
Mon, 12 Jun 2023 17:44:57 +0000 (10:44 -0700)
Change the way we check for a multipath nshead so as
to consistently use the same check to assert the same condition.

Signed-off-by: Irvin Cote <irvincoteg@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index 64c484c..afd2e4a 100644 (file)
@@ -3664,7 +3664,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
         * instance as shared namespaces will show up as multiple block
         * devices.
         */
-       if (ns->head->disk) {
+       if (nvme_ns_head_multipath(ns->head)) {
                sprintf(disk->disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
                        ctrl->instance, ns->head->instance);
                disk->flags |= GENHD_FL_HIDDEN;