From: Christoph Hellwig <hch@lst.de>
To: masahiro31.yamada@kioxia.com
Cc: sagi@grimberg.me, linux-kernel@vger.kernel.org,
linux-nvme@lists.infradead.org, axboe@fb.com, kbusch@kernel.org,
hch@lst.de
Subject: Re: [PATCH] nvme: add a compat_ioctl handler for NVME_IOCTL_SUBMIT_IO
Date: Wed, 4 Mar 2020 17:13:17 +0100 [thread overview]
Message-ID: <20200304161317.GA11268@lst.de> (raw)
In-Reply-To: <c0d7091c43154d9ea7a978c42a78b01a@TGXML281.toshiba.local>
> +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.
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-03-04 16:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 6:28 [PATCH] nvme: add a compat_ioctl handler for NVME_IOCTL_SUBMIT_IO masahiro31.yamada
2020-03-04 16:13 ` Christoph Hellwig [this message]
2020-03-05 11:04 ` masahiro31.yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200304161317.GA11268@lst.de \
--to=hch@lst.de \
--cc=axboe@fb.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=masahiro31.yamada@kioxia.com \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox