aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2021-08-24 16:43:10 +0200
committerJens Axboe <[email protected]>2021-08-24 10:10:08 -0600
commit9f2869921f2a102e209297d4f742f34b46ed3d36 (patch)
treee88e807194cc03f4fdd0dfc56267dcc2c63d84ae
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-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);