[PATCH 1/1] nvme-multipath: show wrong nvme ns after dlpar a nvme device

Christoph Hellwig hch at lst.de
Fri May 27 22:17:15 PDT 2022


On Fri, May 27, 2022 at 10:49:37AM -0500, wenxiong at linux.ibm.com wrote:
> From: Wen Xiong <wenxiong at linux.ibm.com>
> 
> If we have an active partition/namespace on nvme device, nvme device driver
> won’t release these controller IDs/Namespaces IDs when dlpar remove.

What is a dlpar?

> So we got the wrong nvme devices names if nvme device driver still use old
> subsystem id as controller id when dlpar add it back. We expect to see new
> nvme devices with new controller IDs/Namespace IDs.

What is wrong?

> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index d464fdf978fb..945974ceef3c 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -495,7 +495,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
>  	head->disk->fops = &nvme_ns_head_ops;
>  	head->disk->private_data = head;
>  	sprintf(head->disk->disk_name, "nvme%dn%d",
> -			ctrl->subsys->instance, head->instance);
> +			ctrl->instance, head->instance);

No, this is broken.  The name needs to refer to the subsystem instance
as otherwise we will run into naming conflicts.



More information about the Linux-nvme mailing list