io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH io_uring-6.18 1/1] io_uring: fix types for region size calulation
Date: Wed, 5 Nov 2025 11:44:45 -0700	[thread overview]
Message-ID: <43429045-4443-4e5c-a892-4265de2cd026@kernel.dk> (raw)
In-Reply-To: <f883c8cca557438e70423b4831d2e8d17a4eeaf4.1762357551.git.asml.silence@gmail.com>

On 11/5/25 8:47 AM, Pavel Begunkov wrote:
> ->nr_pages is int, it needs type extension before calculating the region
> size.
> 
> Fixes: a90558b36ccee ("io_uring/memmap: helper for pinning region pages")
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
>  io_uring/memmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/io_uring/memmap.c b/io_uring/memmap.c
> index 2e99dffddfc5..fab79c7b3157 100644
> --- a/io_uring/memmap.c
> +++ b/io_uring/memmap.c
> @@ -135,7 +135,7 @@ static int io_region_pin_pages(struct io_ring_ctx *ctx,
>  				struct io_mapped_region *mr,
>  				struct io_uring_region_desc *reg)
>  {
> -	unsigned long size = mr->nr_pages << PAGE_SHIFT;
> +	unsigned long size = (size_t)mr->nr_pages << PAGE_SHIFT;
>  	struct page **pages;
>  	int nr_pages;

Should probably consistently use a size_t, everywhere else does. Doesn't
matter here as io_pin_pages() does the right thing anyway.

-- 
Jens Axboe

  reply	other threads:[~2025-11-05 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05 15:47 [PATCH io_uring-6.18 1/1] io_uring: fix types for region size calulation Pavel Begunkov
2025-11-05 18:44 ` Jens Axboe [this message]
2025-11-06 12:09   ` Pavel Begunkov
2025-11-06 23:23     ` Jens Axboe
2025-11-05 18:45 ` Jens Axboe

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=43429045-4443-4e5c-a892-4265de2cd026@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).