From: Pavel Begunkov <[email protected]>
To: Chenliang Li <[email protected]>,
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: Thu, 20 Jun 2024 11:35:38 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 6/19/24 16:47, Chenliang Li wrote:
>
> 在 2024/6/19 22:27, Pavel Begunkov 写道:
>> 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
> Why 1? There could be multiple bvecs.
You're right
Reviewed-by: Pavel Begunkov <[email protected]>
--
Pavel Begunkov
next prev parent reply other threads:[~2024-06-20 10:35 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
2024-06-19 15:47 ` Chenliang Li
2024-06-20 10:35 ` Pavel Begunkov [this message]
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] \
[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