From: Jens Axboe <axboe@kernel.dk>
To: Avadhut Naik <avadnaik@amd.com>
Cc: Pavel Begunkov <asml.silence@gmail.com>,
stable@vger.kernel.org, Beld Zhang <beldzhang@gmail.com>
Subject: Re: [PATCH 1/3] io_uring/rw: fix short rw error handling
Date: Mon, 19 Sep 2022 15:11:51 -0600 [thread overview]
Message-ID: <ce458190-94b2-e7b7-3c93-36e52879fc93@kernel.dk> (raw)
In-Reply-To: <20220919201741.18519-1-avadnaik@amd.com>
On 9/19/22 2:17 PM, Avadhut Naik wrote:
> From: Pavel Begunkov <asml.silence@gmail.com>
>
> We have a couple of problems, first reports of unexpected link breakage
> for reads when cqe->res indicates that the IO was done in full. The
> reason here is partial IO with retries.
>
> TL;DR; we compare the result in __io_complete_rw_common() against
> req->cqe.res, but req->cqe.res doesn't store the full length but rather
> the length left to be done. So, when we pass the full corrected result
> via kiocb_done() -> __io_complete_rw_common(), it fails.
>
> The second problem is that we don't try to correct res in
> io_complete_rw(), which, for instance, might be a problem for O_DIRECT
> but when a prefix of data was cached in the page cache. We also
> definitely don't want to pass a corrected result into io_rw_done().
>
> The fix here is to leave __io_complete_rw_common() alone, always pass
> not corrected result into it and fix it up as the last step just before
> actually finishing the I/O.
I'm confused by this email, why is it being sent? And what are the 2-3/3
patches?
And while this one should certainly go to stable, also note that:
commit 62bb0647b14646fa6c9aa25ecdf67ad18f13523c
Author: Pavel Begunkov <asml.silence@gmail.com>
Date: Tue Sep 13 13:21:23 2022 +0100
io_uring/rw: fix error'ed retry return values
exists in Linus's tree and should go in alongside the parent as it
fixes the parameter type.
--
Jens Axboe
next prev parent reply other threads:[~2022-09-19 21:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 20:17 [PATCH 1/3] io_uring/rw: fix short rw error handling Avadhut Naik
2022-09-19 21:11 ` Jens Axboe [this message]
2022-09-19 21:44 ` Avadhut Naik
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=ce458190-94b2-e7b7-3c93-36e52879fc93@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=avadnaik@amd.com \
--cc=beldzhang@gmail.com \
--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.