[PATCH 4/4] nvme: add mulitipath warning to nvme_alloc_ns

Christoph Hellwig hch at lst.de
Wed Mar 5 06:37:01 PST 2025


On Thu, Feb 27, 2025 at 10:25:41PM -0500, John Meneghini wrote:
> When CONFIG_NVME_MULTIPATH is disabled, add a warning if
> we discover a multipath enabled controller with an attached
> shared namespace.
> 
> Signed-off-by: John Meneghini <jmeneghi at redhat.com>
> ---
>  drivers/nvme/host/core.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index c2b7e6834535..465069c0f6a8 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3938,6 +3938,15 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info)
>  	} else {
>  		sprintf(disk->disk_name, "nvme%dn%d", ctrl->instance,
>  			ns->head->instance);
> +#ifndef CONFIG_NVME_MULTIPATH

This can use IS_ENABLED to clean the code up a bit.

> +		if ((ctrl->subsys->cmic & NVME_CTRL_CMIC_MULTI_CTRL) && info->is_shared) {

overly long line.




More information about the Linux-nvme mailing list