[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Dec 2019 10:17:44 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
Jens Axboe <axboe@...nel.dk>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jason Wang <jasowang@...hat.com>,
Doug Gilbert <dgilbert@...erlog.com>,
Kai Mäkisara <Kai.Makisara@...umbus.fi>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>,
Stefan Hajnoczi <stefanha@...hat.com>,
Bart Van Assche <bvanassche@....org>,
Hannes Reinecke <hare@...e.com>,
Damien Le Moal <damien.lemoal@....com>,
John Garry <john.garry@...wei.com>,
virtualization@...ts.linux-foundation.org,
linux-block <linux-block@...r.kernel.org>,
linux-scsi <linux-scsi@...r.kernel.org>,
Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 15/24] compat_ioctl: scsi: move ioctl handling into drivers
On Thu, Dec 12, 2019 at 1:28 AM Paolo Bonzini <pbonzini@...hat.com> wrote:
> On 12/12/19 00:05, Michael S. Tsirkin wrote:
> >> @@ -405,6 +405,9 @@ static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
> >>
> >> static const struct block_device_operations virtblk_fops = {
> >> .ioctl = virtblk_ioctl,
> >> +#ifdef CONFIG_COMPAT
> >> + .compat_ioctl = blkdev_compat_ptr_ioctl,
> >> +#endif
> >> .owner = THIS_MODULE,
> >> .getgeo = virtblk_getgeo,
> >> };
> > Hmm - is virtio blk lumped in with scsi things intentionally?
>
> I think it's because the only ioctl for virtio-blk is SG_IO. It makes
> sense to lump it in with scsi, but I wouldn't mind getting rid of
> CONFIG_VIRTIO_BLK_SCSI altogether.
It currently calls scsi_cmd_blk_ioctl(), which implements a bunch of ioctl
commands, including some that are unrelated to SG_IO:
case SG_GET_VERSION_NUM:
case SCSI_IOCTL_GET_IDLUN:
case SCSI_IOCTL_GET_BUS_NUMBER:
case SG_SET_TIMEOUT:
case SG_GET_TIMEOUT:
case SG_GET_RESERVED_SIZE:
case SG_SET_RESERVED_SIZE:
case SG_EMULATED_HOST:
case SG_IO: {
case CDROM_SEND_PACKET:
case SCSI_IOCTL_SEND_COMMAND:
case CDROMCLOSETRAY:
case CDROMEJECT:
My patch changes all callers of this function, and the idea is
to preserve the existing behavior through my series, so I think
it makes sense to keep my patch as is.
I would assume that calling scsi_cmd_blk_ioctl() is harmless
here, but if you want to remove it or limit the set of supported
commands, that should be independent of my change.
Arnd
Powered by blists - more mailing lists