Skip to content

Commit 9f28699

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: refine the disk_live check in del_gendisk
hidden gendisks will never be marked live. Fixes: 40b3a52 ("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]>
1 parent 1743fa5 commit 9f28699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/genhd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ void del_gendisk(struct gendisk *disk)
556556
{
557557
might_sleep();
558558

559-
if (WARN_ON_ONCE(!disk_live(disk)))
559+
if (WARN_ON_ONCE(!disk_live(disk) && !(disk->flags & GENHD_FL_HIDDEN)))
560560
return;
561561

562562
blk_integrity_del(disk);

0 commit comments

Comments
 (0)