aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-23 14:46:20 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-23 14:46:20 -0700
commit95838bd9fcfaa12452dc9fd6d6920faef6bb5a46 (patch)
tree46035e354304a30bee3baa8852a1ac5e6ea8e7d6
parentMerge tag 'arm-fixes-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc (diff)
parentblock: return -EBUSY when there are open partitions in blkdev_reread_part (diff)
downloadwireguard-linux-95838bd9fcfaa12452dc9fd6d6920faef6bb5a46.tar.xz
wireguard-linux-95838bd9fcfaa12452dc9fd6d6920faef6bb5a46.zip
Merge tag 'block-5.12-2021-04-23' of git://git.kernel.dk/linux-block
Pull block fix from Jens Axboe: "A single fix for a behavioral regression in this series, when re-reading the partition table with partitions open" * tag 'block-5.12-2021-04-23' of git://git.kernel.dk/linux-block: block: return -EBUSY when there are open partitions in blkdev_reread_part
Diffstat (limited to '')
-rw-r--r--block/ioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index ff241e663c01..8ba1ed8defd0 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