]> www.infradead.org Git - users/hch/block.git/commitdiff
HACK: force nvme namepace to be shared
authorChristoph Hellwig <hch@lst.de>
Thu, 29 Aug 2024 05:54:56 +0000 (08:54 +0300)
committerChristoph Hellwig <hch@lst.de>
Thu, 29 Aug 2024 06:13:54 +0000 (09:13 +0300)
Quick hack to run the multipath code on ZNS without a real
multi-controller subsystem.

drivers/nvme/host/core.c
drivers/nvme/host/multipath.c

index 75ab62cb4aa454066082a011c67b575ed81ec723..73968130f50926681c5aa4e6e071b7bae9326b28 100644 (file)
@@ -1582,7 +1582,7 @@ static int nvme_ns_info_from_identify(struct nvme_ctrl *ctrl,
        }
 
        info->anagrpid = id->anagrpid;
-       info->is_shared = id->nmic & NVME_NS_NMIC_SHARED;
+       info->is_shared = true; // id->nmic & NVME_NS_NMIC_SHARED;
        info->is_readonly = id->nsattr & NVME_NS_ATTR_RO;
        info->is_ready = true;
        if (ctrl->quirks & NVME_QUIRK_BOGUS_NID) {
@@ -1620,7 +1620,7 @@ static int nvme_ns_info_from_id_cs_indep(struct nvme_ctrl *ctrl,
        ret = nvme_submit_sync_cmd(ctrl->admin_q, &c, id, sizeof(*id));
        if (!ret) {
                info->anagrpid = id->anagrpid;
-               info->is_shared = id->nmic & NVME_NS_NMIC_SHARED;
+               info->is_shared = true; // id->nmic & NVME_NS_NMIC_SHARED;
                info->is_readonly = id->nsattr & NVME_NS_ATTR_RO;
                info->is_ready = id->nstat & NVME_NSTAT_NRDY;
        }
@@ -2943,7 +2943,7 @@ static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
                                subsys->subnqn);
                        return false;
                }
-
+#if 0
                if ((id->cmic & NVME_CTRL_CMIC_MULTI_CTRL) ||
                    nvme_discovery_ctrl(ctrl))
                        continue;
@@ -2951,6 +2951,7 @@ static bool nvme_validate_cntlid(struct nvme_subsystem *subsys,
                dev_err(ctrl->device,
                        "Subsystem does not support multiple controllers\n");
                return false;
+#endif
        }
 
        return true;
index 91d9eb3c22eff264101fc51d7d22b2a676e7cc37..25761fb7d88ff007201c6ce38e6e2771b9766a74 100644 (file)
@@ -609,10 +609,11 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
         * We also do this for private namespaces as the namespace sharing flag
         * could change after a rescan.
         */
+#if 0
        if (!(ctrl->subsys->cmic & NVME_CTRL_CMIC_MULTI_CTRL) ||
            !nvme_is_unique_nsid(ctrl, head) || !multipath)
                return 0;
-
+#endif
        blk_set_stacking_limits(&lim);
        lim.dma_alignment = 3;
        lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL;