diff options
author | 2021-01-22 16:48:13 -0800 | |
---|---|---|
committer | 2021-01-22 16:54:48 -0800 | |
commit | 3a19bb147c72d2e9b77137bf5130b9cfb50a5eef (patch) | |
tree | 9f39a5a28d86e10b55e39d7309f0b74ed8ccdcf9 /fs/xfs/libxfs/xfs_inode_fork.h | |
parent | xfs: Check for extent overflow when renaming dir entries (diff) | |
download | linux-dev-3a19bb147c72d2e9b77137bf5130b9cfb50a5eef.tar.xz linux-dev-3a19bb147c72d2e9b77137bf5130b9cfb50a5eef.zip |
xfs: Check for extent overflow when adding/removing xattrs
Adding/removing an xattr can cause XFS_DA_NODE_MAXDEPTH extents to be
added. One extra extent for dabtree in case a local attr is large enough
to cause a double split. It can also cause extent count to increase
proportional to the size of a remote xattr's value.
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 '')
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_fork.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h index ea1a9dd8a763..8d89838e23f8 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.h +++ b/fs/xfs/libxfs/xfs_inode_fork.h @@ -61,6 +61,16 @@ struct xfs_ifork { ((XFS_DA_NODE_MAXDEPTH + 1 + 1) * (mp)->m_dir_geo->fsbcount) /* + * Adding/removing an xattr can cause XFS_DA_NODE_MAXDEPTH extents to + * be added. One extra extent for dabtree in case a local attr is + * large enough to cause a double split. It can also cause extent + * count to increase proportional to the size of a remote xattr's + * value. + */ +#define XFS_IEXT_ATTR_MANIP_CNT(rmt_blks) \ + (XFS_DA_NODE_MAXDEPTH + max(1, rmt_blks)) + +/* * Fork handling. */ |