]> www.infradead.org Git - users/hch/misc.git/commit
xfs: punch delalloc extents from the COW fork for COW writes
authorChristoph Hellwig <hch@lst.de>
Tue, 8 Oct 2024 08:59:21 +0000 (10:59 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 15 Oct 2024 09:37:42 +0000 (11:37 +0200)
commitf6f91d290c8b9da6e671bd15f306ad2d0e635a04
tree9e70de234d7f2a6c8cac0a593ee8ea2871e6ec9a
parent7d6fe5c586e6a866f9e69a5bdd72a72b977bab8e
xfs: punch delalloc extents from the COW fork for COW writes

When ->iomap_end is called on a short write to the COW fork it needs to
punch stale delalloc data from the COW fork and not the data fork.

Ensure that IOMAP_F_NEW is set for new COW fork allocations in
xfs_buffered_write_iomap_begin, and then use the IOMAP_F_SHARED flag
in xfs_buffered_write_delalloc_punch to decide which fork to punch.

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