mbox series

[0/3] btrfs: a few direct IO fixes/improvements

Message ID cover.1656934419.git.fdmanana@suse.com (mailing list archive)
Headers show
Series btrfs: a few direct IO fixes/improvements | expand

Message

Filipe Manana July 4, 2022, 11:42 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

Several fixes and improvements regarding direct IO, with the first one being
recently reported by Dominique when using qemu with io_uring on images that
have a mix of compressed and non-compressed extents. That in particular
exposed a bug in qemu's handling of partial reads, fixed recently by
Dominique, but despite that we could avoid returning a partial read when
there's really no need to, not just for efficiency but also because many
applications don't take into consideration partial reads (MariaDB for
example didn't use to until recently) or are buggy dealing with them.
More details in the changelogs.

Filipe Manana (3):
  btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and
    inline extents
  btrfs: don't fallback to buffered IO for NOWAIT direct IO writes
  btrfs: fault in pages for dio reads/writes in a more controlled way

 fs/btrfs/file.c  | 72 ++++++++++++++++++++++++++++++++++++------------
 fs/btrfs/inode.c | 14 +++++++++-
 2 files changed, 68 insertions(+), 18 deletions(-)

Comments

David Sterba July 8, 2022, 3:20 p.m. UTC | #1
On Mon, Jul 04, 2022 at 12:42:02PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> Several fixes and improvements regarding direct IO, with the first one being
> recently reported by Dominique when using qemu with io_uring on images that
> have a mix of compressed and non-compressed extents. That in particular
> exposed a bug in qemu's handling of partial reads, fixed recently by
> Dominique, but despite that we could avoid returning a partial read when
> there's really no need to, not just for efficiency but also because many
> applications don't take into consideration partial reads (MariaDB for
> example didn't use to until recently) or are buggy dealing with them.
> More details in the changelogs.
> 
> Filipe Manana (3):
>   btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and
>     inline extents
>   btrfs: don't fallback to buffered IO for NOWAIT direct IO writes
>   btrfs: fault in pages for dio reads/writes in a more controlled way

The first patch was already in misc-next, I've compared the code and
briefly the changelog and it looked exactly the same so I've kept the
patch, 2 and 3 added to misc-next. Thanks.