diff --git a/block/ioctl.c b/block/ioctl.c index ff241e663c018feae6f102065dbcce475eb3ae29..8ba1ed8defd0bb1d705e28531c122b952c3168af 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -89,6 +89,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