[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200304161317.GA11268@lst.de>
Date: Wed, 4 Mar 2020 17:13:17 +0100
From: Christoph Hellwig <hch@....de>
To: masahiro31.yamada@...xia.com
Cc: kbusch@...nel.org, axboe@...com, hch@....de, sagi@...mberg.me,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvme: add a compat_ioctl handler for
NVME_IOCTL_SUBMIT_IO
> +static int nvme_compat_ioctl(struct block_device *bdev, fmode_t mode,
> + unsigned int cmd, unsigned long arg)
> +{
> + if (cmd == NVME_IOCTL_SUBMIT_IO32)
> + return nvme_ioctl(bdev, mode, NVME_IOCTL_SUBMIT_IO, arg);
I think this really need a comment explaining what is going on, including
why not translating anything works in this specific case.
> +
> + return nvme_ioctl(bdev, mode, cmd, arg);
> +}
This function should also be under CONFIG_COMPAT, with a
#define nvme_compat_ioctl NULL
in the #else branch.
> index d99b5a772698..52699a26b9b3 100644
> --- a/include/uapi/linux/nvme_ioctl.h
> +++ b/include/uapi/linux/nvme_ioctl.h
> @@ -24,6 +24,21 @@ struct nvme_user_io {
> __u16 appmask;
> };
>
> +struct nvme_user_io32 {
> + __u8 opcode;
> + __u8 flags;
> + __u16 control;
> + __u16 nblocks;
> + __u16 rsvd;
> + __u64 metadata;
> + __u64 addr;
> + __u64 slba;
> + __u32 dsmgmt;
> + __u32 reftag;
> + __u16 apptag;
> + __u16 appmask;
> +} __attribute__((packed));
This should not be exposed in the UAPI header. I think it should just
go into the #ifdef CONFIG_COMPAT block in core.c near the comment and
the compat_ioctl handler.
Powered by blists - more mailing lists