linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH] nvme: Fix disk names when not using nvme multipath
Date: Wed, 18 Apr 2018 07:26:58 -0600	[thread overview]
Message-ID: <20180418132657.GJ11513@localhost.localdomain> (raw)
In-Reply-To: <20180418064412.GB11757@lst.de>

On Wed, Apr 18, 2018@08:44:12AM +0200, Christoph Hellwig wrote:
> On Tue, Apr 17, 2018@04:03:44PM -0600, Keith Busch wrote:
> > When CONFIG_NVME_MULTIPATH is set, but we're not using nvme to multipath,
> > namespaces with multiple paths were not creating unique names due to
> > reusing the same instance number from the namespace's head.
> 
> Hmm.  They should still differ in the controller instance, though.
> 
> Shouldn't we need something like this instead (untested):
> 
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 197a6ba9700f..bfd67bc71455 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3001,10 +3001,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
>  		sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
>  				ctrl->cntlid, ns->head->instance);
>  		flags = GENHD_FL_HIDDEN;
> -	} else {
> -		sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance,
> -				ns->head->instance);
> -	}
> +	} else
>  #else
>  	/*
>  	 * But without the multipath code enabled, multiple controller per

No-can-do. If we did that with nvme-multipath, we could find NMIC
namespaces using the susbystem instance for the disk name, and non-NMIC
using the controller instance: we'll have a different set of name
conflicts to deal with.

  reply	other threads:[~2018-04-18 13:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 22:03 [PATCH] nvme: Fix disk names when not using nvme multipath Keith Busch
2018-04-18  6:44 ` Christoph Hellwig
2018-04-18 13:26   ` Keith Busch [this message]
2018-04-18 15:04     ` Christoph Hellwig
2018-04-18 15:34       ` Keith Busch
2018-04-18 15:34         ` Christoph Hellwig
2018-04-18 16:09           ` Keith Busch
2018-04-19  8:50             ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180418132657.GJ11513@localhost.localdomain \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).