diff --git a/fs/block_dev.c b/fs/block_dev.c index a5a6a7930e5e..389609bc5aa3 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1244,6 +1244,9 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate) lockdep_assert_held(&bdev->bd_mutex); + if (!(disk->flags & GENHD_FL_UP)) + return -ENXIO; + rescan: ret = blk_drop_partitions(bdev); if (ret)