summaryrefslogtreecommitdiff
path: root/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-24 16:43:10 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-24 10:10:08 -0600
commit9f2869921f2a102e209297d4f742f34b46ed3d36 (patch)
treee88e807194cc03f4fdd0dfc56267dcc2c63d84ae /block/genhd.c
parent1743fa54c9e8247000e060fcdab406ab3a808223 (diff)
block: refine the disk_live check in del_gendisk
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> Link: https://lore.kernel.org/r/20210824144310.1487816-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 6a5b65c86c4b..567549a011d1 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -556,7 +556,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);