提交 9f286992 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: refine the disk_live check in del_gendisk

hidden gendisks will never be marked live.

Fixes: 40b3a52f ("block: add a sanity check for a live disk in del_gendisk")
Reported-by: NBruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210824144310.1487816-1-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 1743fa54
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册