summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-18 16:45:32 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-23 12:55:45 -0600
commit40b3a52ffc5bc3b5427d5d35b035cfb19d03fdd6 (patch)
treef385e3f1902e95c68dec0b90f4fe6e8fc46ea7cf /block
parentd152c682f03ceb65c0d9663d4ba6ee2d46aa784d (diff)
downloadlinux-40b3a52ffc5bc3b5427d5d35b035cfb19d03fdd6.tar.bz2
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20210818144542.19305-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 02cd9ec93e52..935f74c652f1 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -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);