From: Chandan Babu R Date: Mon, 5 Apr 2021 21:58:14 +0000 (-0400) Subject: xfs: Check for extent overflow when punching a hole X-Git-Tag: v5.12.0-rc0~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65f4eca092adef55b46037779d02d4e956a9bdb7;p=thirdparty%2Fxfsprogs-dev.git xfs: Check for extent overflow when punching a hole Source kernel commit: 85ef08b5a667615bc7be5058259753dc42a7adcd The extent mapping the file offset at which a hole has to be inserted will be split into two extents causing extent count to increase by 1. Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig 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 7fc2b129a..bcac769a7 100644 --- a/libxfs/xfs_inode_fork.h +++ b/libxfs/xfs_inode_fork.h @@ -40,6 +40,13 @@ struct xfs_ifork { */ #define XFS_IEXT_ADD_NOSPLIT_CNT (1) +/* + * Punching out an extent from the middle of an existing extent can cause the + * extent count to increase by 1. + * i.e. | Old extent | Hole | Old extent | + */ +#define XFS_IEXT_PUNCH_HOLE_CNT (1) + /* * Fork handling. */