linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs: fix corruption caused by partial dio writes v6
@ 2023-03-24  2:31 Christoph Hellwig
  2023-03-24  2:31 ` [PATCH 01/11] btrfs: add function to create and return an ordered extent Christoph Hellwig
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Christoph Hellwig @ 2023-03-24  2:31 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Boris Burkov, Johannes Thumshirn, Naohiro Aota, linux-btrfs

[this is a resend of the series from Boris, with my changes to avoid
 the three-way split in btrfs_extract_ordered_extent inserted in the
 middle]

The final patch in this series ensures that bios submitted by btrfs dio
match the corresponding ordered_extent and extent_map exactly. As a
result, there is no hole or deadlock as a result of partial writes, even
if the write buffer is a partly overlapping mapping of the range being
written to.

This required a bit of refactoring and setup. Specifically, the zoned
device code for "extracting" an ordered extent matching a bio could be
reused with some refactoring to return the new ordered extents after the
split.

Changes since v5:
 - avoid three-way splits in btrfs_extract_ordered_extent

^ permalink raw reply	[flat|nested] 23+ messages in thread
* btrfs: fix corruption caused by partial dio writes v7
@ 2023-03-28  5:19 Christoph Hellwig
  2023-03-28  5:19 ` [PATCH 07/11] btrfs: fold btrfs_clone_ordered_extent into btrfs_split_ordered_extent Christoph Hellwig
  0 siblings, 1 reply; 23+ messages in thread
From: Christoph Hellwig @ 2023-03-28  5:19 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba
  Cc: Boris Burkov, Johannes Thumshirn, Naohiro Aota, linux-btrfs

[this is a resend of the series from Boris, with my changes to avoid
 the three-way split in btrfs_extract_ordered_extent inserted in the
 middle]

The final patch in this series ensures that bios submitted by btrfs dio
match the corresponding ordered_extent and extent_map exactly. As a
result, there is no hole or deadlock as a result of partial writes, even
if the write buffer is a partly overlapping mapping of the range being
written to.

This required a bit of refactoring and setup. Specifically, the zoned
device code for "extracting" an ordered extent matching a bio could be
reused with some refactoring to return the new ordered extents after the
split.


Changes since v6:
 - use ERR_CAST
 - clarify a commit log

Changes since v5:
 - avoid three-way splits in btrfs_extract_ordered_extent

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

end of thread, other threads:[~2023-03-28  5:20 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24  2:31 btrfs: fix corruption caused by partial dio writes v6 Christoph Hellwig
2023-03-24  2:31 ` [PATCH 01/11] btrfs: add function to create and return an ordered extent Christoph Hellwig
2023-03-24  5:47   ` Naohiro Aota
2023-03-25  8:22     ` Christoph Hellwig
2023-03-24  2:31 ` [PATCH 02/11] btrfs: pass flags as unsigned long to btrfs_add_ordered_extent Christoph Hellwig
2023-03-24  4:53   ` Naohiro Aota
2023-03-24  2:31 ` [PATCH 03/11] btrfs: stash ordered extent in dio_data during iomap dio Christoph Hellwig
2023-03-24  7:41   ` Naohiro Aota
2023-03-24  2:32 ` [PATCH 04/11] btrfs: move ordered_extent internal sanity checks into btrfs_split_ordered_extent Christoph Hellwig
2023-03-24  2:32 ` [PATCH 05/11] btrfs: simplify btrfs_extract_ordered_extent Christoph Hellwig
2023-03-24  6:07   ` Naohiro Aota
2023-03-25  8:34     ` Christoph Hellwig
2023-03-24  2:32 ` [PATCH 06/11] btrfs: simplify btrfs_split_ordered_extent Christoph Hellwig
2023-03-24  7:52   ` Naohiro Aota
2023-03-25  8:37     ` Christoph Hellwig
2023-03-24  2:32 ` [PATCH 07/11] btrfs: fold btrfs_clone_ordered_extent into btrfs_split_ordered_extent Christoph Hellwig
2023-03-24  2:32 ` [PATCH 08/11] btrfs: simplify split_zoned_em Christoph Hellwig
2023-03-24  2:32 ` [PATCH 09/11] btrfs: pass an ordered_extent to btrfs_extract_ordered_extent Christoph Hellwig
2023-03-24  2:32 ` [PATCH 10/11] btrfs: don't split nocow extent_maps in btrfs_extract_ordered_extent Christoph Hellwig
2023-03-24  2:32 ` [PATCH 11/11] btrfs: split partial dio bios before submit Christoph Hellwig
2023-03-24 13:10 ` btrfs: fix corruption caused by partial dio writes v6 Johannes Thumshirn
2023-03-24 16:36   ` Johannes Thumshirn
2023-03-28  5:19 btrfs: fix corruption caused by partial dio writes v7 Christoph Hellwig
2023-03-28  5:19 ` [PATCH 07/11] btrfs: fold btrfs_clone_ordered_extent into btrfs_split_ordered_extent Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).