]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: make COW fork unwritten extent conversions more robust
authorChristoph Hellwig <hch@lst.de>
Mon, 6 May 2019 22:00:29 +0000 (18:00 -0400)
committerEric Sandeen <sandeen@redhat.com>
Mon, 6 May 2019 22:00:29 +0000 (18:00 -0400)
commit9fa4db19c63c4d4319b8381c644f453291d76d44
treeb14e2a2d44bd14a7c67fbbb7a61b240ff2c8571a
parent9e26de8f5f78ae89e6771f332a7ff09e050a6686
xfs: make COW fork unwritten extent conversions more robust

Source kernel commit: 26b91c728b2d15952432371dc2b6ba1dda1fb61f

If we have racing buffered and direct I/O COW fork extents under
writeback can have been moved to the data fork by the time we call
xfs_reflink_convert_cow from xfs_submit_ioend.  This would be mostly
harmless as the block numbers don't change by this move, except for
the fact that xfs_bmapi_write will crash or trigger asserts when
not finding existing extents, even despite trying to paper over this
with the XFS_BMAPI_CONVERT_ONLY flag.

Instead of special casing non-transaction conversions in the already
way too complicated xfs_bmapi_write just add a new helper for the much
simpler non-transactional COW fork case, which simplify ignores not
found extents.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h