summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-03 11:00:15 +0100
committerJens Axboe <axboe@kernel.dk>2020-11-16 08:14:29 -0700
commit732e12d805a77f74c907c0a28ece271ef1e81e01 (patch)
tree4cff0fc2859dff39ad803449a3114c1389ea13d3 /block
parent2c1b6ec170423bb032e825d4d9b2780bac4ce1a9 (diff)
downloadlinux-stable-732e12d805a77f74c907c0a28ece271ef1e81e01.tar.gz
linux-stable-732e12d805a77f74c907c0a28ece271ef1e81e01.tar.bz2
linux-stable-732e12d805a77f74c907c0a28ece271ef1e81e01.zip
block: don't call into the driver for BLKROSET
Now that all drivers that want to hook into setting or clearing the read-only flag use the set_read_only method, this code can be removed. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/ioctl.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index a6fa16b97705..96cb45447364 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -346,26 +346,6 @@ static int blkdev_pr_clear(struct block_device *bdev,
return ops->pr_clear(bdev, c.key);
}
-/*
- * Is it an unrecognized ioctl? The correct returns are either
- * ENOTTY (final) or ENOIOCTLCMD ("I don't know this one, try a
- * fallback"). ENOIOCTLCMD gets turned into ENOTTY by the ioctl
- * code before returning.
- *
- * Confused drivers sometimes return EINVAL, which is wrong. It
- * means "I understood the ioctl command, but the parameters to
- * it were wrong".
- *
- * We should aim to just fix the broken drivers, the EINVAL case
- * should go away.
- */
-static inline int is_unrecognized_ioctl(int ret)
-{
- return ret == -EINVAL ||
- ret == -ENOTTY ||
- ret == -ENOIOCTLCMD;
-}
-
static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
unsigned cmd, unsigned long arg)
{
@@ -384,9 +364,6 @@ static int blkdev_roset(struct block_device *bdev, fmode_t mode,
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
- ret = __blkdev_driver_ioctl(bdev, mode, cmd, arg);
- if (!is_unrecognized_ioctl(ret))
- return ret;
if (get_user(n, (int __user *)arg))
return -EFAULT;
if (bdev->bd_disk->fops->set_read_only) {