linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Coly Li <colyli@suse.de>, Song Liu <song@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	linux-block@vger.kernel.org, linux-bcache@vger.kernel.org,
	linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-nvme@lists.infradead.org
Subject: [PATCH 3/8] nvme: remove the GENHD_FL_UP check in nvme_ns_remove
Date: Mon,  9 Aug 2021 08:40:23 +0200	[thread overview]
Message-ID: <20210809064028.1198327-4-hch@lst.de> (raw)
In-Reply-To: <20210809064028.1198327-1-hch@lst.de>

Early probe failure never reaches nvme_ns_remove, so GENHD_FL_UP must
be set at this point.  Remove the check.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/core.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index dfd9dec0c1f6..e24a0143fd87 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3826,14 +3826,12 @@ 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 (!nvme_ns_head_multipath(ns->head))
-			nvme_cdev_del(&ns->cdev, &ns->cdev_device);
-		del_gendisk(ns->disk);
-		blk_cleanup_queue(ns->queue);
-		if (blk_get_integrity(ns->disk))
-			blk_integrity_unregister(ns->disk);
-	}
+	if (!nvme_ns_head_multipath(ns->head))
+		nvme_cdev_del(&ns->cdev, &ns->cdev_device);
+	del_gendisk(ns->disk);
+	blk_cleanup_queue(ns->queue);
+	if (blk_get_integrity(ns->disk))
+		blk_integrity_unregister(ns->disk);
 
 	down_write(&ns->ctrl->namespaces_rwsem);
 	list_del_init(&ns->list);
-- 
2.30.2


  parent reply	other threads:[~2021-08-09  6:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09  6:40 remove GENHD_FL_UP Christoph Hellwig
2021-08-09  6:40 ` [PATCH 1/8] mmc: block: let device_add_disk create disk attributes Christoph Hellwig
2021-08-09 11:30   ` Ulf Hansson
2021-08-09  6:40 ` [PATCH 2/8] mmc: block: cleanup gendisk creation Christoph Hellwig
2021-08-09 11:30   ` Ulf Hansson
2021-08-09  6:40 ` Christoph Hellwig [this message]
2021-08-09  6:40 ` [PATCH 4/8] nvme: replace the GENHD_FL_UP check in nvme_mpath_shutdown_disk Christoph Hellwig
2021-08-09  6:40 ` [PATCH 5/8] sx8: use the internal state machine to check if del_gendisk needs to be called Christoph Hellwig
2021-08-09  6:40 ` [PATCH 6/8] bcache: add proper error unwinding in bcache_device_init Christoph Hellwig
2021-08-12 15:48   ` Coly Li
2021-08-09  6:40 ` [PATCH 7/8] bcache: move the del_gendisk call out of bcache_device_free Christoph Hellwig
2021-08-12  8:38   ` Coly Li
2021-08-09  6:40 ` [PATCH 8/8] block: remove GENHD_FL_UP Christoph Hellwig
2021-08-12 16:30 ` Jens Axboe

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=20210809064028.1198327-4-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=colyli@suse.de \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=song@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --subject='Re: [PATCH 3/8] nvme: remove the GENHD_FL_UP check in nvme_ns_remove' \
    /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

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).