Skip to content

Commit fdde50c

Browse files
committed
Merge: nvme: remove multipath module parameter
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/374 nvme: remove multipath module parameter JIRA: https://issues.redhat.com/browse/RHEL-78133 Upstream Status: RHEL-only Since device-mapper multipath will no longer be operating on NVMe devices, there is no longer a need for the "multipath" parameter. Note that, when compiled with CONFIG_NVME_MULTIPATH off multi-path capable controllers and namespaces will continue to present multiple device entries - one for each controller/namespace discovered. This could be confusing, as device-mapper multipath relies upon code in nvme/host/multipath.c, and running device-mapper multipath with a kernel compiled with CONFIG_NVME_MULTIPATH disabled is not supported. Closes: https://lore.kernel.org/linux-nvme/20241121220321.40616-1-bgurney@redhat.com/ Tested-by: John Meneghini <jmeneghi@redhat.com> Reviewed-by: John Meneghini <jmeneghi@redhat.com> Signed-off-by: Bryan Gurney <bgurney@redhat.com> Approved-by: John Meneghini <jmeneghi@redhat.com> Approved-by: Ewan D. Milne <emilne@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 5d21252 + 49c4fe0 commit fdde50c

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,14 +3767,6 @@ static int nvme_init_ns_head(struct nvme_ns *ns, struct nvme_ns_info *info)
37673767
info->nsid);
37683768
goto out_put_ns_head;
37693769
}
3770-
3771-
if (!multipath) {
3772-
dev_warn(ctrl->device,
3773-
"Found shared namespace %d, but multipathing not supported.\n",
3774-
info->nsid);
3775-
dev_warn_once(ctrl->device,
3776-
"Support for shared namespaces without CONFIG_NVME_MULTIPATH is deprecated and will be removed in Linux 6.0.\n");
3777-
}
37783770
}
37793771

37803772
list_add_tail_rcu(&ns->siblings, &head->list);
@@ -3873,12 +3865,14 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
38733865
sprintf(disk->disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
38743866
ctrl->instance, ns->head->instance);
38753867
disk->flags |= GENHD_FL_HIDDEN;
3876-
} else if (multipath) {
3868+
} else {
3869+
#ifdef CONFIG_NVME_MULTIPATH
38773870
sprintf(disk->disk_name, "nvme%dn%d", ctrl->subsys->instance,
38783871
ns->head->instance);
3879-
} else {
3872+
#else
38803873
sprintf(disk->disk_name, "nvme%dn%d", ctrl->instance,
38813874
ns->head->instance);
3875+
#endif
38823876
}
38833877

38843878
if (nvme_update_ns_info(ns, info))

drivers/nvme/host/multipath.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
#include <trace/events/block.h>
1010
#include "nvme.h"
1111

12-
bool multipath = true;
13-
module_param(multipath, bool, 0444);
14-
MODULE_PARM_DESC(multipath,
15-
"turn on native support for multiple controllers per subsystem");
16-
1712
static const char *nvme_iopolicy_names[] = {
1813
[NVME_IOPOLICY_NUMA] = "numa",
1914
[NVME_IOPOLICY_RR] = "round-robin",
@@ -626,9 +621,11 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
626621
* We also do this for private namespaces as the namespace sharing flag
627622
* could change after a rescan.
628623
*/
624+
#ifdef CONFIG_NVME_MULTIPATH
629625
if (!(ctrl->subsys->cmic & NVME_CTRL_CMIC_MULTI_CTRL) ||
630-
!nvme_is_unique_nsid(ctrl, head) || !multipath)
626+
!nvme_is_unique_nsid(ctrl, head))
631627
return 0;
628+
#endif
632629

633630
blk_set_stacking_limits(&lim);
634631
lim.dma_alignment = 3;
@@ -1033,10 +1030,11 @@ int nvme_mpath_init_identify(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
10331030
size_t ana_log_size;
10341031
int error = 0;
10351032

1033+
#ifdef CONFIG_NVME_MULTIPATH
10361034
/* check if multipath is enabled and we have the capability */
1037-
if (!multipath || !ctrl->subsys ||
1038-
!(ctrl->subsys->cmic & NVME_CTRL_CMIC_ANA))
1035+
if (!ctrl->subsys || !(ctrl->subsys->cmic & NVME_CTRL_CMIC_ANA))
10391036
return 0;
1037+
#endif
10401038

10411039
/* initialize this in the identify path to cover controller resets */
10421040
atomic_set(&ctrl->nr_active, 0);

drivers/nvme/host/nvme.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,6 @@ static inline void nvme_trace_bio_complete(struct request *req)
971971
trace_block_bio_complete(ns->head->disk->queue, req->bio);
972972
}
973973

974-
extern bool multipath;
975974
extern struct device_attribute dev_attr_ana_grpid;
976975
extern struct device_attribute dev_attr_ana_state;
977976
extern struct device_attribute subsys_attr_iopolicy;
@@ -981,7 +980,6 @@ static inline bool nvme_disk_is_ns_head(struct gendisk *disk)
981980
return disk->fops == &nvme_ns_head_ops;
982981
}
983982
#else
984-
#define multipath false
985983
static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl)
986984
{
987985
return false;

0 commit comments

Comments
 (0)