Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Avadhut Naik <avadnaik@amd.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Pavel Begunkov <asml.silence@gmail.com>,
	stable@vger.kernel.org, Beld Zhang <beldzhang@gmail.com>
Subject: [PATCH 1/3] io_uring/rw: fix short rw error handling
Date: Mon, 19 Sep 2022 16:44:12 -0500	[thread overview]
Message-ID: <2f13d9fa-4c33-eddc-e873-b84519ac241b@amd.com> (raw)
In-Reply-To: <ce458190-94b2-e7b7-3c93-36e52879fc93@kernel.dk>

Hi,

Please ignore this email. It has been sent by mistake.
Wont happen again.

Sincerest apologies for the spam.

Thanks and Regards,
Avadhut Naik


On 9/19/2022 4:11 PM, Jens Axboe wrote:
> 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.
> 

      reply	other threads:[~2022-09-19 21:44 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
2022-09-19 21:44   ` Avadhut Naik [this message]

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=2f13d9fa-4c33-eddc-e873-b84519ac241b@amd.com \
    --to=avadnaik@amd.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox