linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Luis Chamberlain <mcgrof@kernel.org>, axboe@kernel.dk
Cc: bvanassche@acm.org, ming.lei@redhat.com, hch@infradead.org,
	jack@suse.cz, osandov@fb.com, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC 5/6] nvme: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED
Date: Fri, 16 Jul 2021 07:53:15 +0200	[thread overview]
Message-ID: <e9212eb9-269c-47d1-60d8-f5282ad5c441@suse.de> (raw)
In-Reply-To: <20210715202341.2016612-6-mcgrof@kernel.org>

On 7/15/21 10:23 PM, Luis Chamberlain wrote:
> The GENHD_FL_DISK_ADDED flag is what we really want, as the
> flag GENHD_FL_UP could be set on a semi-initialized device.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
>   drivers/nvme/host/core.c      | 4 ++--
>   drivers/nvme/host/multipath.c | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 11779be42186..3848353fba11 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1819,7 +1819,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
>   static inline bool nvme_first_scan(struct gendisk *disk)
>   {
>   	/* nvme_alloc_ns() scans the disk prior to adding it */
> -	return !(disk->flags & GENHD_FL_UP);
> +	return !(disk->flags & GENHD_FL_DISK_ADDED);
>   }
>   
>   static void nvme_set_chunk_sectors(struct nvme_ns *ns, struct nvme_id_ns *id)
> @@ -3823,7 +3823,7 @@ static void nvme_ns_remove(struct nvme_ns *ns)
>   	nvme_mpath_clear_current_path(ns);
>   	synchronize_srcu(&ns->head->srcu); /* wait for concurrent submissions */
>   
> -	if (ns->disk->flags & GENHD_FL_UP) {
> +	if (ns->disk->flags & GENHD_FL_DISK_ADDED) {
>   		if (!nvme_ns_head_multipath(ns->head))
>   			nvme_cdev_del(&ns->cdev, &ns->cdev_device);
>   		del_gendisk(ns->disk);
> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index 0ea5298469c3..8048678969ba 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -764,7 +764,7 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head)
>   {
>   	if (!head->disk)
>   		return;
> -	if (head->disk->flags & GENHD_FL_UP) {
> +	if (head->disk->flags & GENHD_FL_DISK_ADDED) {
>   		nvme_cdev_del(&head->cdev, &head->cdev_device);
>   		del_gendisk(head->disk);
>   	}
> 
Same here: please use the wrapper.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

  reply	other threads:[~2021-07-16  5:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 20:23 [RFC 0/6] block: enhance use of GENHD_FL_UP Luis Chamberlain
2021-07-15 20:23 ` [RFC 1/6] genhd: update docs for GENHD_FL_UP Luis Chamberlain
2021-07-16  5:50   ` Hannes Reinecke
2021-07-19  9:52   ` Christoph Hellwig
2021-07-15 20:23 ` [RFC 2/6] block: add flag for add_disk() completion notation Luis Chamberlain
2021-07-16  5:49   ` Hannes Reinecke
2021-07-16 20:00     ` Luis Chamberlain
2021-07-19 10:00   ` Christoph Hellwig
2021-07-19 22:38     ` Luis Chamberlain
2021-07-15 20:23 ` [RFC 3/6] md: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED on is_mddev_broken() Luis Chamberlain
2021-07-16  5:51   ` Hannes Reinecke
2021-07-16 20:02     ` Luis Chamberlain
2021-07-28 19:20   ` Guilherme G. Piccoli
2021-07-15 20:23 ` [RFC 4/6] mmc/core/block: replace GENHD_FL_UP with GENHD_FL_DISK_ADDED Luis Chamberlain
2021-07-16  5:51   ` Hannes Reinecke
2021-07-15 20:23 ` [RFC 5/6] nvme: " Luis Chamberlain
2021-07-16  5:53   ` Hannes Reinecke [this message]
2021-07-15 20:23 ` [RFC 6/6] fs/block_dev: " Luis Chamberlain
2021-07-19  9:56 ` [RFC 0/6] block: enhance use of GENHD_FL_UP 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=e9212eb9-269c-47d1-60d8-f5282ad5c441@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@fb.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).