mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
block: refine the disk_live check in del_gendisk
hidden gendisks will never be marked live.
Fixes: 40b3a52ffc
("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>
This commit is contained in:
parent
1743fa54c9
commit
9f2869921f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user