• Chandan Babu R's avatar
    xfs: Directory's data fork extent counter can never overflow · 83a21c18
    Chandan Babu R authored
    The maximum file size that can be represented by the data fork extent counter
    in the worst case occurs when all extents are 1 block in length and each block
    is 1KB in size.
    
    With XFS_MAX_EXTCNT_DATA_FORK_SMALL representing maximum extent count and with
    1KB sized blocks, a file can reach upto,
    (2^31) * 1KB = 2TB
    
    This is much larger than the theoretical maximum size of a directory
    i.e. XFS_DIR2_SPACE_SIZE * 3 = ~96GB.
    
    Since a directory's inode can never overflow its data fork extent counter,
    this commit removes all the overflow checks associated with
    it. xfs_dinode_verify() now performs a rough check to verify if a diretory's
    data fork is larger than 96GB.
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Signed-off-by: default avatarChandan Babu R <chandan.babu@oracle.com>
    83a21c18
xfs_symlink.c 12.1 KB