Merge tag 'regulator-fix-v5.19-rc0' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-starfive.git] / block / genhd.c
index 36532b9..27205ae 100644 (file)
@@ -385,6 +385,8 @@ int disk_scan_partitions(struct gendisk *disk, fmode_t mode)
 
        if (disk->flags & (GENHD_FL_NO_PART | GENHD_FL_HIDDEN))
                return -EINVAL;
+       if (test_bit(GD_SUPPRESS_PART_SCAN, &disk->state))
+               return -EINVAL;
        if (disk->open_partitions)
                return -EBUSY;