[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5826d31fcf2fcbe25bf2396e32df3df7d585dd99.camel@codethink.co.uk>
Date: Wed, 18 Dec 2019 20:11:51 +0000
From: Ben Hutchings <ben.hutchings@...ethink.co.uk>
To: Arnd Bergmann <arnd@...db.de>, Jens Axboe <axboe@...nel.dk>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-scsi@...r.kernel.org, linux-block@...r.kernel.org,
y2038@...ts.linaro.org, linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@....de>, linux-doc@...r.kernel.org,
corbet@....net, viro@...iv.linux.org.uk,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2 21/27] compat_ioctl: move cdrom commands into cdrom.c
On Tue, 2019-12-17 at 23:17 +0100, Arnd Bergmann wrote:
[...]
> @@ -1710,6 +1711,38 @@ static int idecd_ioctl(struct block_device *bdev, fmode_t mode,
> return ret;
> }
>
> +#ifdef CONFIG_COMPAT
> +static int idecd_locked_compat_ioctl(struct block_device *bdev, fmode_t mode,
> + unsigned int cmd, unsigned long arg)
> +{
> + struct cdrom_info *info = ide_drv_g(bdev->bd_disk, cdrom_info);
> + int err;
> +
> + switch (cmd) {
> + case CDROMSETSPINDOWN:
> + return idecd_set_spindown(&info->devinfo, arg);
> + case CDROMGETSPINDOWN:
> + return idecd_get_spindown(&info->devinfo, arg);
compat_ptr() should also be applied to the argument for these two
commands, though I'm fairly sure IDE drivers have never been useful on
s390 so it doesn't matter in practice.
Ben.
> + default:
> + break;
> + }
> +
> + return cdrom_ioctl(&info->devinfo, bdev, mode, cmd,
> + (unsigned long)compat_ptr(arg));
> +}
[...]
--
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom
Powered by blists - more mailing lists