X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=block%2Fcompat_ioctl.c;h=fd537fdb25a3c6fddd5058629c0b30145dc18744;hb=90b8f2824ce68dd87d304641a1d5a048dfff39f5;hp=1e559fba7bdfc58859605b0d9fdc879346f86b07;hpb=620f2efcdc5c7a2db68da41bc3df3cf9a718024e;p=mirror_ubuntu-bionic-kernel.git diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c index 1e559fba7bdf..fd537fdb25a3 100644 --- a/block/compat_ioctl.c +++ b/block/compat_ioctl.c @@ -708,17 +708,7 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, struct file *file, return -ENOIOCTLCMD; } - if (disk->fops->unlocked_ioctl) - return disk->fops->unlocked_ioctl(file, cmd, arg); - - if (disk->fops->ioctl) { - lock_kernel(); - ret = disk->fops->ioctl(inode, file, cmd, arg); - unlock_kernel(); - return ret; - } - - return -ENOTTY; + return __blkdev_driver_ioctl(inode->i_bdev, file->f_mode, cmd, arg); } static int compat_blkdev_locked_ioctl(struct inode *inode, struct file *file, @@ -805,10 +795,9 @@ long compat_blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) lock_kernel(); ret = compat_blkdev_locked_ioctl(inode, file, bdev, cmd, arg); - /* FIXME: why do we assume -> compat_ioctl needs the BKL? */ - if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl) - ret = disk->fops->compat_ioctl(file, cmd, arg); unlock_kernel(); + if (ret == -ENOIOCTLCMD && disk->fops->compat_ioctl) + ret = disk->fops->compat_ioctl(bdev, file->f_mode, cmd, arg); if (ret != -ENOIOCTLCMD) return ret;