summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_inode_buf.c
diff options
context:
space:
mode:
authorChandan Babu R <chandan.babu@oracle.com>2021-08-09 12:05:22 +0530
committerChandan Babu R <chandan.babu@oracle.com>2022-04-11 04:11:17 +0000
commit95f0b95e2b686ceaa3f465e9fa079f22e0fe7665 (patch)
tree6ad802b3e0cc7f9cccc1d7e051bc7d5c6f003955 /fs/xfs/libxfs/xfs_inode_buf.c
parent3b0d9fd369ea48419ccb578e0bafa4c54df63ba6 (diff)
downloadlinux-stable-95f0b95e2b686ceaa3f465e9fa079f22e0fe7665.tar.gz
linux-stable-95f0b95e2b686ceaa3f465e9fa079f22e0fe7665.tar.bz2
linux-stable-95f0b95e2b686ceaa3f465e9fa079f22e0fe7665.zip
xfs: Define max extent length based on on-disk format definition
The maximum extent length depends on maximum block count that can be stored in a BMBT record. Hence this commit defines MAXEXTLEN based on BMBT_BLOCKCOUNT_BITLEN. While at it, the commit also renames MAXEXTLEN to XFS_MAX_BMBT_EXTLEN. Suggested-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index cae9708c8587..87781a5d5a45 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -639,7 +639,7 @@ xfs_inode_validate_extsize(
if (extsize_bytes % blocksize_bytes)
return __this_address;
- if (extsize > MAXEXTLEN)
+ if (extsize > XFS_MAX_BMBT_EXTLEN)
return __this_address;
if (!rt_flag && extsize > mp->m_sb.sb_agblocks / 2)
@@ -696,7 +696,7 @@ xfs_inode_validate_cowextsize(
if (cowextsize_bytes % mp->m_sb.sb_blocksize)
return __this_address;
- if (cowextsize > MAXEXTLEN)
+ if (cowextsize > XFS_MAX_BMBT_EXTLEN)
return __this_address;
if (cowextsize > mp->m_sb.sb_agblocks / 2)