summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
authorChandan Babu R <chandanrlinux@gmail.com>2021-01-22 16:48:11 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-01-22 16:54:47 -0800
commit85ef08b5a667615bc7be5058259753dc42a7adcd (patch)
tree3eb09dee8e0beb0bd23eed4541b324f0dfd035e1 /fs/xfs/libxfs
parent727e1acd297cae15449607d6e2ee39c71216cf1a (diff)
downloadlinux-stable-85ef08b5a667615bc7be5058259753dc42a7adcd.tar.gz
linux-stable-85ef08b5a667615bc7be5058259753dc42a7adcd.tar.bz2
linux-stable-85ef08b5a667615bc7be5058259753dc42a7adcd.zip
xfs: Check for extent overflow when punching a hole
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 <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
index 7fc2b129a2e7..bcac769a7df6 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.h
+++ b/fs/xfs/libxfs/xfs_inode_fork.h
@@ -41,6 +41,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.
*/