public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Chenliang Li <[email protected]>, [email protected]
Cc: [email protected], [email protected],
	[email protected], [email protected],
	[email protected], [email protected]
Subject: Re: [PATCH] io_uring/rsrc: fix incorrect assignment of iter->nr_segs in io_import_fixed
Date: Wed, 19 Jun 2024 15:27:07 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 6/19/24 07:38, Chenliang Li wrote:
> In io_import_fixed when advancing the iter within the first bvec, the
> iter->nr_segs is set to bvec->bv_len. nr_segs should be the number of
> bvecs, plus we don't need to adjust it here, so just remove it.

Good catch, quite old. It's our luck that bvec iteration
honours the length and doesn't step outside of the first entry.

> Fixes: b000ae0ec2d7 ("io_uring/rsrc: optimise single entry advance")
> Signed-off-by: Chenliang Li <[email protected]>
> ---
>   io_uring/rsrc.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
> index 60c00144471a..a860516bf448 100644
> --- a/io_uring/rsrc.c
> +++ b/io_uring/rsrc.c
> @@ -1049,7 +1049,6 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
>   			 * branch doesn't expect non PAGE_SIZE'd chunks.
>   			 */
>   			iter->bvec = bvec;
> -			iter->nr_segs = bvec->bv_len;

iter->nr_segs = 1, please


>   			iter->count -= offset;
>   			iter->iov_offset = offset;
>   		} else {
> 
> base-commit: 3b87184f7eff27fef7d7ee18b65f173152e1bb81

-- 
Pavel Begunkov

  reply	other threads:[~2024-06-19 14:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240619063825epcas5p26224fc244b0ff14899731dea6d5a674b@epcas5p2.samsung.com>
2024-06-19  6:38 ` [PATCH] io_uring/rsrc: fix incorrect assignment of iter->nr_segs in io_import_fixed Chenliang Li
2024-06-19 14:27   ` Pavel Begunkov [this message]
2024-06-19 15:47     ` Chenliang Li
2024-06-20 10:35       ` Pavel Begunkov
2024-06-20 12:52   ` 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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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