Merge tag 'atomic-writes-6.16_2025-05-07' of https://git.kernel.org/pub/scm/linux...
authorCarlos Maiolino <cem@kernel.org>
Fri, 9 May 2025 07:15:39 +0000 (09:15 +0200)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 May 2025 07:15:39 +0000 (09:15 +0200)
commit4abb9052a72bc98d521b0535b5deee243a3bbd12
tree84d2565a35dbbfc296866e6cf4b5fed7869f9816
parent23be716b1c4f3f3a6c00ee38d51a57ef7db9ef7d
parent4528b9052731f14c1a9be16b98e33c9401e6d1bc
Merge tag 'atomic-writes-6.16_2025-05-07' of https://git./linux/kernel/git/djwong/xfs-linux into atomic_writes

large atomic writes for xfs [v12.1]

Currently atomic write support for xfs is limited to writing a single
block as we have no way to guarantee alignment and that the write covers
a single extent.

This series introduces a method to issue atomic writes via a
software-based method.

The software-based method is used as a fallback for when attempting to
issue an atomic write over misaligned or multiple extents.

For xfs, this support is based on reflink CoW support.

The basic idea of this CoW method is to alloc a range in the CoW fork,
write the data, and atomically update the mapping.

Initial mysql performance testing has shown this method to perform ok.
However, there we are only using 16K atomic writes (and 4K block size),
so typically - and thankfully - this software fallback method won't be
used often.

For other FSes which want large atomics writes and don't support CoW, I
think that they can follow the example in [0].

Catherine is currently working on further xfstests for this feature,
which we hope to share soon.

About 17/17, maybe it can be omitted as there is no strong demand to have
it included.

Based on bfecc4091e07 (xfs/next-rc, xfs/for-next) xfs: allow ro mounts
if rtdev or logdev are read-only

[0] https://lore.kernel.org/linux-xfs/20250102140411.14617-1-john.g.garry@oracle.com/

Differences to v12:
- add more review tags

Differences to v11:
- split "xfs: ignore ..." patch
- inline sync_blockdev() in xfs_alloc_buftarg() (Christoph)
- fix xfs_calc_rtgroup_awu_max() for 0 block count (Darrick)
- Add RB tag from Christoph (thanks!)

Differences to v10:
- add "xfs: only call xfs_setsize_buftarg once ..." by Darrick
- symbol renames in "xfs: ignore HW which cannot..." by Darrick

Differences to v9:
- rework "ignore HW which cannot .." patch by Darrick
- Ensure power-of-2 max always for unit min/max when no HW support

With a bit of luck, this should all go splendidly.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>