Thread (2 messages) 2 messages, 2 authors, 2021-08-24

[PATCH] block: refine the disk_live check in del_gendisk

flat view
STALE1874d LANDED

From: Christoph Hellwig <hch@lst.de>
Date: 2021-08-24 14:45:45
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

Landed in mainline as 9f2869921f2a on 2021-08-24.

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 <redacted>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help