]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: commit CoW-based atomic writes atomically
authorJohn Garry <john.g.garry@oracle.com>
Tue, 1 Jul 2025 17:45:12 +0000 (10:45 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 15 Jul 2025 05:12:03 +0000 (22:12 -0700)
commit8ccf3002f5f71ba0b0919e6aca82e962e222ccb1
tree518db945167d9cd8cabfea1deec5e45a0adb7d95
parent5049ea2e832a0a1827edd7b8c32c4310cd5275e7
xfs: commit CoW-based atomic writes atomically

Source kernel commit: b1e09178b73adf10dc87fba9aee7787a7ad26874

When completing a CoW-based write, each extent range mapping update is
covered by a separate transaction.

For a CoW-based atomic write, all mappings must be changed at once, so
change to use a single transaction.

Note that there is a limit on the amount of log intent items which can be
fit into a single transaction, but this is being ignored for now since
the count of items for a typical atomic write would be much less than is
typically supported. A typical atomic write would be expected to be 64KB
or less, which means only 16 possible extents unmaps, which is quite
small.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[djwong: add tr_atomic_ioend]
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
libxfs/xfs_log_rlimit.c
libxfs/xfs_trans_resv.c
libxfs/xfs_trans_resv.h