linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>,
	linux-nvme@lists.infradead.org
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Jens Axboe <axboe@fb.com>
Subject: Re: [PATCH 3/4] nvme: Should not warn when a disk path is opened
Date: Thu, 13 Dec 2018 10:16:54 +0100	[thread overview]
Message-ID: <c8d9ca76-10bc-4827-f1bd-3164a15fcd33@suse.de> (raw)
In-Reply-To: <20181206164812.30925-4-cascardo@canonical.com>

On 12/6/18 5:48 PM, Thadeu Lima de Souza Cascardo wrote:
> As we hide the disks used for nvme multipath, their open functions
> should be allowed to be called, as their devices are not exposed.
> 
> However, not exposing the devices cause problems with lsblk, which won't
> find the devices and show them, which is even more of a problem when
> holders/slaves relationships are exposed.
> 
> Not warning here allow us to expose the disks without creating spurious
> warnings. A failure should still be returned, which is the case here,
> and still allows lsblk to work.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>   drivers/nvme/host/core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 1dc29795f1ee..22424b2adfad 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1327,8 +1327,8 @@ static int nvme_open(struct block_device *bdev, fmode_t mode)
>   	struct nvme_ns *ns = bdev->bd_disk->private_data;
>   
>   #ifdef CONFIG_NVME_MULTIPATH
> -	/* should never be called due to GENHD_FL_HIDDEN */
> -	if (WARN_ON_ONCE(ns->head->disk))
> +	/* Should fail as it's hidden */
> +	if (ns->head->disk)
>   		goto fail;
>   #endif
>   	if (!kref_get_unless_zero(&ns->kref))
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

  reply	other threads:[~2018-12-13  9:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 16:48 [PATCH 0/4] nvme multipath: expose slaves/holders Thadeu Lima de Souza Cascardo
2018-12-06 16:48 ` [PATCH 1/4] block: move holder tracking from struct block_device to hd_struct Thadeu Lima de Souza Cascardo
2018-12-13  9:14   ` Hannes Reinecke
2018-12-06 16:48 ` [PATCH 2/4] nvme: create slaves/holder entries for multipath devices Thadeu Lima de Souza Cascardo
2018-12-13  9:15   ` Hannes Reinecke
2018-12-06 16:48 ` [PATCH 3/4] nvme: Should not warn when a disk path is opened Thadeu Lima de Souza Cascardo
2018-12-13  9:16   ` Hannes Reinecke [this message]
2018-12-06 16:48 ` [PATCH 4/4] block: expose devt for GENHD_FL_HIDDEN disks Thadeu Lima de Souza Cascardo
2018-12-06 20:22   ` Christoph Hellwig
2018-12-12  8:32     ` Christoph Hellwig
2018-12-12 12:39     ` Thadeu Lima de Souza Cascardo
2018-12-13  9:18   ` Hannes Reinecke
2018-12-13 11:41     ` Thadeu Lima de Souza Cascardo
2018-12-13 12:19       ` Hannes Reinecke
2018-12-13 16:08         ` Thadeu Lima de Souza Cascardo
2018-12-13 14:32     ` Christoph Hellwig
2018-12-13 15:25       ` Thadeu Lima de Souza Cascardo
2018-12-13 20:20         ` Christoph Hellwig
2018-12-13 21:00           ` Thadeu Lima de Souza Cascardo
2018-12-14  7:47         ` Hannes Reinecke
2018-12-14  8:56           ` Thadeu Lima de Souza Cascardo
2018-12-14  9:06             ` Thadeu Lima de Souza Cascardo
2018-12-14  9:54               ` Hannes Reinecke
2018-12-14 10:18                 ` Hannes Reinecke
2018-12-14 11:09                 ` Thadeu Lima de Souza Cascardo
2018-12-14  9:44             ` Hannes Reinecke
2018-12-13  9:33 ` [PATCH 0/4] nvme multipath: expose slaves/holders Johannes Thumshirn
2018-12-13 11:35   ` Thadeu Lima de Souza Cascardo

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=c8d9ca76-10bc-4827-f1bd-3164a15fcd33@suse.de \
    --to=hare@suse.de \
    --cc=axboe@fb.com \
    --cc=cascardo@canonical.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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).