Skip to content

Commit 40b3a52

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent d152c68 commit 40b3a52

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
@@ -579,7 +579,7 @@ void del_gendisk(struct gendisk *disk)
579579
{
580580
might_sleep();
581581

582-
if (WARN_ON_ONCE(!disk->queue))
582+
if (WARN_ON_ONCE(!disk_live(disk)))
583583
return;
584584

585585
blk_integrity_del(disk);

0 commit comments

Comments
 (0)