diff --git a/block/ioctl.c b/block/ioctl.c index 3be4d0e2a96c32ce23d0aba39f6a446c2437d9d6..ed240e170e148b0aa3009ad77a8d179328f54f3b 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -98,6 +98,8 @@ static int blkdev_reread_part(struct block_device *bdev, fmode_t mode) return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EACCES; + if (bdev->bd_part_count) + return -EBUSY; /* * Reopen the device to revalidate the driver state and force a