]> www.infradead.org Git - users/dwmw2/linux.git/commit
xfs: set IOMAP_F_SHARED for all COW fork allocations
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Oct 2024 08:59:20 +0000 (10:59 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 15 Oct 2024 09:37:42 +0000 (11:37 +0200)
commit7d6fe5c586e6a866f9e69a5bdd72a72b977bab8e
tree473e0b452cfbcc995f586ab31e5414145221c6b9
parentc29440ff66d6f24be5e9e313c1c0eca7212faf9e
xfs: set IOMAP_F_SHARED for all COW fork allocations

Change to always set xfs_buffered_write_iomap_begin for COW fork
allocations even if they don't overlap existing data fork extents,
which will allow the iomap_end callback to detect if it has to punch
stale delalloc blocks from the COW fork instead of the data fork.  It
also means we sample the sequence counter for both the data and the COW
fork when writing to the COW fork, which ensures we properly revalidate
when only COW fork changes happens.

This is essentially a revert of commit 72a048c1056a ("xfs: only set
IOMAP_F_SHARED when providing a srcmap to a write"). This is fine because
the problem that the commit fixed has now been dealt with in iomap by
only looking at the actual srcmap and not the fallback to the write
iomap.

Note that the direct I/O path was never changed and has always set
IOMAP_F_SHARED for all COW fork allocations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_iomap.c