All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs: minor fixes and cleanups on direct IO path
@ 2026-06-05  9:01 Qu Wenruo
  2026-06-05  9:01 ` [PATCH 1/4] btrfs: return the written number if there is any progress for dio Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Qu Wenruo @ 2026-06-05  9:01 UTC (permalink / raw)
  To: linux-btrfs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-06-05 22:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05  9:01 [PATCH 0/4] btrfs: minor fixes and cleanups on direct IO path Qu Wenruo
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

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.