From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/4] btrfs: minor fixes and cleanups on direct IO path
Date: Fri, 5 Jun 2026 18:31:02 +0930 [thread overview]
Message-ID: <cover.1780645090.git.wqu@suse.com> (raw)
There are several small problems inside the direct IO code:
- btrfs_direct_write() ignores any submitted bytes
Any error code will have a higher priority than the @written value.
Fixed in the first patch.
- Possible direct and buffered OE conflicts if falling back to buffered
If btrfs_dio_iomap_begin() is called and created an OE, but later
nothing is submitted and needs to fallback to buffered, then the OE
is only finished but not yet removed.
The removal of an OE is always delayed, thus there is a window that
the buffered write can create an OE, causing conflicts.
Fixed in the second patch.
- Duplicated btrfs_dio_data::submitted
The iomap_end() callback has @written parameter which provides the
same value.
Fixed in the third patch.
- Badly structured btrfs_dio_iomap_end()
Refactored in the last patch.
Qu Wenruo (4):
btrfs: return the written number if there is any progress for dio
btrfs: wait for OE to be fully removed before falling back to buffered
btrfs: remove btrfs_dio_data::submitted
btrfs: refactor btrfs_dio_iomap_end()
fs/btrfs/direct-io.c | 150 ++++++++++++++++++++++++-------------------
1 file changed, 84 insertions(+), 66 deletions(-)
--
2.54.0
next reply other threads:[~2026-06-05 9:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-05 9:01 Qu Wenruo [this message]
2026-06-05 9:01 ` [PATCH 1/4] btrfs: return the written number if there is any progress for dio Qu Wenruo
2026-06-05 10:05 ` Filipe Manana
2026-06-05 22:01 ` Qu Wenruo
2026-06-05 9:01 ` [PATCH 2/4] btrfs: wait for OE to be fully removed before falling back to buffered Qu Wenruo
2026-06-05 10:10 ` Filipe Manana
2026-06-05 21:43 ` Qu Wenruo
2026-06-05 9:01 ` [PATCH 3/4] btrfs: remove btrfs_dio_data::submitted Qu Wenruo
2026-06-05 9:01 ` [PATCH 4/4] btrfs: refactor btrfs_dio_iomap_end() Qu Wenruo
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=cover.1780645090.git.wqu@suse.com \
--to=wqu@suse.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 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.