xfs: Check for extent overflow when adding/removing xattrs
authorChandan Babu R <chandanrlinux@gmail.com>
Sat, 23 Jan 2021 00:48:13 +0000 (16:48 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Sat, 23 Jan 2021 00:54:48 +0000 (16:54 -0800)
commit3a19bb147c72d2e9b77137bf5130b9cfb50a5eef
tree9f39a5a28d86e10b55e39d7309f0b74ed8ccdcf9
parent02092a2f034fdeabab524ae39c2de86ba9ffa15a
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>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_inode_fork.h