From: Nilay Shroff <nilay@linux.ibm.com>
To: Keith Busch <kbusch@meta.com>,
linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me
Cc: Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH 2/6] nvme-ioctl: use common type for user data addresses
Date: Tue, 25 Feb 2025 19:59:59 +0530 [thread overview]
Message-ID: <456288e1-9c17-4284-892f-c6ccba45f2cc@linux.ibm.com> (raw)
In-Reply-To: <20250224182128.2042061-3-kbusch@meta.com>
On 2/24/25 11:51 PM, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> The data type is represented as a u64, but the metadata type as a __user
> void *. These two fields represent the same thing, so treating them so
> differently looks a bit odd. Just pick one consistent type of
> representation.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/ioctl.c | 30 ++++++++++++++----------------
> 1 file changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
> index a3082414c7714..f1233a280d3b3 100644
> --- a/drivers/nvme/host/ioctl.c
> +++ b/drivers/nvme/host/ioctl.c
> @@ -114,7 +114,7 @@ static struct request *nvme_alloc_user_request(struct request_queue *q,
> }
>
> static int nvme_map_user_request(struct request *req, u64 ubuffer,
> - unsigned bufflen, void __user *meta_buffer, unsigned meta_len,
> + unsigned bufflen, u64 meta_buffer, unsigned meta_len,
> struct io_uring_cmd *ioucmd, unsigned int flags)
> {
> struct request_queue *q = req->q;
> @@ -161,7 +161,8 @@ static int nvme_map_user_request(struct request *req, u64 ubuffer,
> bio_set_dev(bio, bdev);
>
> if (has_metadata) {
> - ret = blk_rq_integrity_map_user(req, meta_buffer, meta_len);
> + ret = blk_rq_integrity_map_user(req,
> + nvme_to_user_ptr(meta_buffer), meta_len);
> if (ret)
> goto out_unmap;
> }
As we're stripping __user, for readability, can we name it as "umeta_buffer" or
"user_meta_buffer"? The regular user data buffer is already named as "ubuffer".
Otherwise this is good.
Thanks,
--Nilay
next prev parent reply other threads:[~2025-02-25 16:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 18:21 [PATCH 0/6] nvme ioctl cleanups Keith Busch
2025-02-24 18:21 ` [PATCH 1/6] nvme-ioctl: fold open_for_write into flags Keith Busch
2025-02-24 22:17 ` Damien Le Moal
2025-02-24 22:21 ` Chaitanya Kulkarni
2025-02-24 23:10 ` Christoph Hellwig
2025-02-25 9:05 ` Kanchan Joshi
2025-02-24 18:21 ` [PATCH 2/6] nvme-ioctl: use common type for user data addresses Keith Busch
2025-02-24 22:22 ` Damien Le Moal
2025-02-24 22:30 ` Christoph Hellwig
2025-02-24 22:47 ` Keith Busch
2025-02-25 9:07 ` Kanchan Joshi
2025-02-25 14:29 ` Nilay Shroff [this message]
2025-02-24 18:21 ` [PATCH 3/6] nvme-ioctl: fold 'vec' into flags Keith Busch
2025-02-24 22:23 ` Damien Le Moal
2025-02-24 22:34 ` Christoph Hellwig
2025-02-25 9:08 ` Kanchan Joshi
2025-02-24 18:21 ` [PATCH 4/6] nvme-ioctl: common user timeout setting Keith Busch
2025-02-24 22:29 ` Damien Le Moal
2025-02-24 22:34 ` Christoph Hellwig
2025-02-25 9:08 ` Kanchan Joshi
2025-02-24 18:21 ` [PATCH 5/6] nvme-ioctl: combine alloc and map Keith Busch
2025-02-24 22:30 ` Damien Le Moal
2025-02-24 22:35 ` Christoph Hellwig
2025-02-25 9:33 ` Kanchan Joshi
2025-02-24 18:21 ` [PATCH 6/6] nvme-ioctl: simplify parameters Keith Busch
2025-02-24 22:32 ` Damien Le Moal
2025-02-24 22:37 ` Christoph Hellwig
2025-02-25 9:35 ` Kanchan Joshi
2025-02-25 0:44 ` [PATCH 0/6] nvme ioctl cleanups Chaitanya Kulkarni
2025-03-03 20:03 ` Keith Busch
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=456288e1-9c17-4284-892f-c6ccba45f2cc@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-nvme@lists.infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.