summaryrefslogtreecommitdiff
path: root/block/ioctl.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-25 11:24:42 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-25 11:24:42 -0700
commitcbb245239282870bc6f54d5137dfe0f84b48ea72 (patch)
treedcdd8041d7bb5cddacfe086785dd370aa1a7a6ea /block/ioctl.c
parent94a332bd8626f6c32e7ba5835dd17eeddbb76e89 (diff)
parent9f4ad9e425a1d3b6a34617b8ea226d56a119a717 (diff)
Merge tag 'v5.12' into next
Sync up with mainline to get the latest device tree bindings and kernel APIs.
Diffstat (limited to 'block/ioctl.c')
-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