From: Josef Bacik <josef@toxicpanda.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com,
Dylan Yudaken <dylany@fb.com>, Jens Axboe <axboe@kernel.dk>,
agruenba@redhat.com
Subject: Re: [PATCH] btrfs: handle DIO read faults properly
Date: Fri, 19 Aug 2022 11:55:15 -0400 [thread overview]
Message-ID: <Yv+yY1A0msNqHG76@localhost.localdomain> (raw)
In-Reply-To: <20220812090208.GA2373742@falcondesktop>
On Fri, Aug 12, 2022 at 10:02:08AM +0100, Filipe Manana wrote:
> On Thu, Aug 11, 2022 at 05:06:11PM -0400, Josef Bacik wrote:
> > Dylan reported a problem where he had an io_uring test that was returning
> > short DIO reads with ee5b46a353af ("btrfs: increase direct io read size
> > limit to 256 sectors") applied. This turned out to be a red herring,
> > this simply increases the size of the reads we'll attempt to do in one
> > go. The root of the problem is that because we're now trying to read in
> > more into our buffer, we're more likely to hit a page fault while trying
> > to read into the buffer.
> >
> > Because we pass IOMAP_DIO_PARTIAL into iomap if we get an -EFAULT we'll
> > simply return 0, expecting that we'll do the fault and then try again.
> > However since we're only checking for a ret > 0 || ret == -EFAULT we
> > return a short read.
>
> I find this explanation to be terse. There's a lot of non-obvious details missing.
>
Turns out there was some weirdness with the reproducer, and this isn't actually
the problem.
The real problem is that we would submit part of the IO since we got a fault,
and because we are async we'd get the short read. I've sent a different patch
with the actual explanation for what was happening and a proper fix for this
particular regression. Thanks,
Josef
prev parent reply other threads:[~2022-08-19 16:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 21:06 [PATCH] btrfs: handle DIO read faults properly Josef Bacik
2022-08-12 9:02 ` Filipe Manana
2022-08-12 15:39 ` Josef Bacik
2022-08-19 15:55 ` Josef Bacik [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=Yv+yY1A0msNqHG76@localhost.localdomain \
--to=josef@toxicpanda.com \
--cc=agruenba@redhat.com \
--cc=axboe@kernel.dk \
--cc=dylany@fb.com \
--cc=fdmanana@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@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