From: Stefan Metzmacher <[email protected]>
To: Jens Axboe <[email protected]>, io-uring <[email protected]>
Subject: Re: [PATCH] io_uring: fix truncated async read/readv and write/writev retry
Date: Thu, 12 Mar 2020 10:36:54 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
[-- Attachment #1.1: Type: text/plain, Size: 1318 bytes --]
Hi Jens,
I haven't looked at the change in detail, but I'm wondering if this
would be needed in stable too?
metze
Am 11.03.20 um 19:30 schrieb Jens Axboe:
> Ensure we keep the truncated value, if we did truncate it. If not, we
> might read/write more than the registered buffer size.
>
> Also for retry, ensure that we return the truncated mapped value for
> the vectorized versions of the read/write commands.
>
> Signed-off-by: Jens Axboe <[email protected]>
>
> ---
>
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 9f1a462eb780..55afae6f0cf4 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -2360,6 +2360,7 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
> *iovec = NULL;
> return PTR_ERR(buf);
> }
> + req->rw.len = sqe_len;
> }
>
> ret = import_single_range(rw, buf, sqe_len, *iovec, iter);
> @@ -2379,8 +2380,10 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
>
> if (req->flags & REQ_F_BUFFER_SELECT) {
> ret = io_iov_buffer_select(req, *iovec, needs_lock);
> - if (!ret)
> - iov_iter_init(iter, rw, *iovec, 1, (*iovec)->iov_len);
> + if (!ret) {
> + ret = (*iovec)->iov_len;
> + iov_iter_init(iter, rw, *iovec, 1, ret);
> + }
> *iovec = NULL;
> return ret;
> }
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-03-12 9:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 18:30 [PATCH] io_uring: fix truncated async read/readv and write/writev retry Jens Axboe
2020-03-12 9:36 ` Stefan Metzmacher [this message]
2020-03-12 12:58 ` 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] \
/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