From: Chandan Babu R Date: Mon, 5 Apr 2021 21:58:16 +0000 (-0400) Subject: xfs: Check for extent overflow when swapping extents X-Git-Tag: v5.12.0-rc0~15 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=24bc2803b2a96026269f75a2d09274ee19e5d4b7;p=thirdparty%2Fxfsprogs-dev.git xfs: Check for extent overflow when swapping extents Source kernel commit: bcc561f21f115437a010307420fc43d91be91c66 Removing an initial range of source/donor file's extent and adding a new extent (from donor/source file) in its place will cause extent count to increase by 1. Reviewed-by: Darrick J. Wong Reviewed-by: Allison Henderson Signed-off-by: Chandan Babu R Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_inode_fork.h b/libxfs/xfs_inode_fork.h index c8f279edc..9e2137cd7 100644 --- a/libxfs/xfs_inode_fork.h +++ b/libxfs/xfs_inode_fork.h @@ -88,6 +88,13 @@ struct xfs_ifork { */ #define XFS_IEXT_REFLINK_END_COW_CNT (2) +/* + * Removing an initial range of source/donor file's extent and adding a new + * extent (from donor/source file) in its place will cause extent count to + * increase by 1. + */ +#define XFS_IEXT_SWAP_RMAP_CNT (1) + /* * Fork handling. */