提交 40b3a52f 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

block: add a sanity check for a live disk in del_gendisk

Add a sanity check to del_gendisk to do nothing when the disk wasn't
successfully added.  This papers over the complete lack of add_disk
error handling, which is about to get fixed gradually.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20210818144542.19305-2-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 d152c682
......@@ -579,7 +579,7 @@ void del_gendisk(struct gendisk *disk)
{
might_sleep();
if (WARN_ON_ONCE(!disk->queue))
if (WARN_ON_ONCE(!disk_live(disk)))
return;
blk_integrity_del(disk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册