Commit 1804dc87 authored by Eric Sandeen's avatar Eric Sandeen Committed by Nathan Scott

[XFS] Add filesystem size limit even when XFS_BIG_BLKNOS is

in effect; limited by page cache index size (16T on ia32)

SGI Modid: xfs-linux:xfs-kern:175103a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent e216aeea
...@@ -278,17 +278,22 @@ xfs_mount_validate_sb( ...@@ -278,17 +278,22 @@ xfs_mount_validate_sb(
return XFS_ERROR(EFSCORRUPTED); return XFS_ERROR(EFSCORRUPTED);
} }
#if !XFS_BIG_BLKNOS ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
ASSERT(sbp->sb_blocklog >= BBSHIFT);
#if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */
if (unlikely(
(sbp->sb_dblocks >> (PAGE_SHIFT - sbp->sb_blocklog)) > ULONG_MAX ||
(sbp->sb_rblocks >> (PAGE_SHIFT - sbp->sb_blocklog)) > ULONG_MAX)) {
#else /* Limited by UINT_MAX of sectors */
if (unlikely( if (unlikely(
(sbp->sb_dblocks << (__uint64_t)(sbp->sb_blocklog - BBSHIFT)) (sbp->sb_dblocks << (sbp->sb_blocklog - BBSHIFT)) > UINT_MAX ||
> UINT_MAX || (sbp->sb_rblocks << (sbp->sb_blocklog - BBSHIFT)) > UINT_MAX)) {
(sbp->sb_rblocks << (__uint64_t)(sbp->sb_blocklog - BBSHIFT)) #endif
> UINT_MAX)) {
cmn_err(CE_WARN, cmn_err(CE_WARN,
"XFS: File system is too large to be mounted on this system."); "XFS: File system is too large to be mounted on this system.");
return XFS_ERROR(E2BIG); return XFS_ERROR(E2BIG);
} }
#endif
if (unlikely(sbp->sb_inprogress)) { if (unlikely(sbp->sb_inprogress)) {
cmn_err(CE_WARN, "XFS: file system busy"); cmn_err(CE_WARN, "XFS: file system busy");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment