block: return -EBUSY when there are open partitions in blkdev_reread_part
PATCH 1/1 block: return -EBUSY when there are open partitions in blkdev_reread_part
The switch to go through blkdev_get_by_dev means we now ignore the return value from bdev_disk_changed in __blkdev_get. Add a manual check to restore the old semantics.
Fixes 4601b4b130de ("block: reopen the device in blkdev_reread_part")
Reported-by Karel Zak <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
--- block/ioctl.c | 2 ++ 1 file changed, 2 insertions(+)
block/ioctl.c +2 -0
@@ -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
Signature · 1 line
2.30.1
Quoted 3 lines · Christoph Hellwig
The switch to go through
blkdev_get_by_devmeans we now ignore the return value frombdev_disk_changedin__blkdev_get. Add a manual check to restore the old semantics.
Applied, thanks.
Signature · 1 line
Jens Axboe