All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
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 4/6] nvme-ioctl: common user timeout setting
Date: Tue, 25 Feb 2025 07:29:01 +0900	[thread overview]
Message-ID: <b15b831d-a54b-4b0d-9aa2-af43d73de58f@kernel.org> (raw)
In-Reply-To: <20250224182128.2042061-5-kbusch@meta.com>

On 2/25/25 03:21, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
> 
> Most of the passthrough paths repeat the same request timeout setup, so
> make it common with the request allocation.
> 
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
>  drivers/nvme/host/ioctl.c | 23 +++++++----------------
>  1 file changed, 7 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
> index 3da014ccbe550..1f28fc4b341dd 100644
> --- a/drivers/nvme/host/ioctl.c
> +++ b/drivers/nvme/host/ioctl.c
> @@ -101,7 +101,7 @@ static void __user *nvme_to_user_ptr(uintptr_t ptrval)
>  
>  static struct request *nvme_alloc_user_request(struct request_queue *q,
>  		struct nvme_command *cmd, blk_opf_t rq_flags,
> -		blk_mq_req_flags_t blk_flags)
> +		blk_mq_req_flags_t blk_flags, unsigned timeout_ms)
>  {
>  	struct request *req;
>  
> @@ -110,6 +110,7 @@ static struct request *nvme_alloc_user_request(struct request_queue *q,
>  		return req;
>  	nvme_init_request(req, cmd);
>  	nvme_req(req)->flags |= NVME_REQ_USERCMD;
> +	req->timeout = timeout_ms ? msecs_to_jiffies(timeout_ms) : 0;

Should we check for overflows / MAX_JIFFY_OFFSET here ?

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2025-02-24 22:29 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
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 [this message]
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=b15b831d-a54b-4b0d-9aa2-af43d73de58f@kernel.org \
    --to=dlemoal@kernel.org \
    --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.