linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: refine the disk_live check in del_gendisk
@ 2021-08-24 14:43 Christoph Hellwig
  2021-08-24 16:10 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2021-08-24 14:43 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, Bruno Goncalves

hidden gendisks will never be marked live.

Fixes: 40b3a52ffc5b ("block: add a sanity check for a live disk in del_gendisk")
Reported-by: Bruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/genhd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/genhd.c b/block/genhd.c
index a925f773145f..6a5c85aa2e31 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -591,7 +591,7 @@ void del_gendisk(struct gendisk *disk)
 {
 	might_sleep();
 
-	if (WARN_ON_ONCE(!disk_live(disk)))
+	if (WARN_ON_ONCE(!disk_live(disk) && !(disk->flags & GENHD_FL_HIDDEN)))
 		return;
 
 	blk_integrity_del(disk);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: refine the disk_live check in del_gendisk
  2021-08-24 14:43 [PATCH] block: refine the disk_live check in del_gendisk Christoph Hellwig
@ 2021-08-24 16:10 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-08-24 16:10 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block, Bruno Goncalves

On 8/24/21 8:43 AM, Christoph Hellwig wrote:
> hidden gendisks will never be marked live.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-24 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-24 14:43 [PATCH] block: refine the disk_live check in del_gendisk Christoph Hellwig
2021-08-24 16:10 ` Jens Axboe

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