From: Jens Axboe <axboe@kernel.dk>
To: Dylan Yudaken <dylany@fb.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: FAILED: patch "[PATCH] io_uring: fix provided buffer import" failed to apply to 5.18-stable tree
Date: Tue, 5 Jul 2022 08:38:19 -0600 [thread overview]
Message-ID: <7fc4edd2-e394-6dfc-dd81-b2cad102dca0@kernel.dk> (raw)
In-Reply-To: <459dd43dc3f05e34eaf520752f3eb46daacd536a.camel@fb.com>
On 7/5/22 8:36 AM, Dylan Yudaken wrote:
> On Mon, 2022-07-04 at 15:24 +0200, gregkh@linuxfoundation.org wrote:
>>
>> The patch below does not apply to the 5.18-stable tree.
>> If someone wants it applied there, or to any other stable or longterm
>> tree, then please email the backport, including the original git
>> commit
>> id to <stable@vger.kernel.org>.
>>
>> thanks,
>>
>> greg k-h
>>
>> ------------------ original commit in Linus's tree ------------------
>>
>> From 09007af2b627f0f195c6c53c4829b285cc3990ec Mon Sep 17 00:00:00
>> 2001
>> From: Dylan Yudaken <dylany@fb.com>
>> Date: Thu, 30 Jun 2022 06:20:06 -0700
>> Subject: [PATCH] io_uring: fix provided buffer import
>>
>> io_import_iovec uses the s pointer, but this was changed immediately
>> after the iovec was re-imported and so it was imported into the wrong
>> place.
>>
>> Change the ordering.
>>
>> Fixes: 2be2eb02e2f5 ("io_uring: ensure reads re-import for selected
>> buffers")
>> Signed-off-by: Dylan Yudaken <dylany@fb.com>
>> Link:
>> https://lore.kernel.org/r/20220630132006.2825668-1-dylany@fb.com
>> [axboe: ensure we don't half-import as well]
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index aeb042ba5cc5..0d491ad15b66 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -4318,18 +4318,19 @@ static int io_read(struct io_kiocb *req,
>> unsigned int issue_flags)
>> if (unlikely(ret < 0))
>> return ret;
>> } else {
>> + rw = req->async_data;
>> + s = &rw->s;
>> +
>> /*
>> * Safe and required to re-import if we're using
>> provided
>> * buffers, as we dropped the selected one before
>> retry.
>> */
>> - if (req->flags & REQ_F_BUFFER_SELECT) {
>> + if (io_do_buffer_select(req)) {
>> ret = io_import_iovec(READ, req, &iovec, s,
>> issue_flags);
>> if (unlikely(ret < 0))
>> return ret;
>> }
>>
>> - rw = req->async_data;
>> - s = &rw->s;
>> /*
>> * We come here from an earlier attempt, restore our
>> state to
>> * match in case it doesn't. It's cheap enough that
>> we don't
>>
>
> Hi,
>
> I have attached a fixed patch which fixes the problem on 5.18
Looks good to me, thanks Dylan!
--
Jens Axboe
next prev parent reply other threads:[~2022-07-05 14:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 13:24 FAILED: patch "[PATCH] io_uring: fix provided buffer import" failed to apply to 5.18-stable tree gregkh
2022-07-05 14:36 ` Dylan Yudaken
2022-07-05 14:38 ` Jens Axboe [this message]
2022-07-07 18:06 ` gregkh
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=7fc4edd2-e394-6dfc-dd81-b2cad102dca0@kernel.dk \
--to=axboe@kernel.dk \
--cc=dylany@fb.com \
--cc=gregkh@linuxfoundation.org \
--cc=stable@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 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.