提交 657a4cff 编写于 作者: E Eric Sandeen 提交者: Alex Elder

xfs: replace E2BIG with EFBIG where appropriate

Many places in the xfs code return E2BIG when they really mean
EFBIG; trying to grow past 16T on a 32 bit machine, for example,
says "Argument list too long" rather than "File too large" which is
not particularly helpful.

Some of these don't make perfect sense as EFBIG either, but still
better than E2BIG IMHO.
Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAlex Elder <aelder@sgi.com>
上级 ccf7c23f
...@@ -268,10 +268,10 @@ xfs_sb_validate_fsb_count( ...@@ -268,10 +268,10 @@ xfs_sb_validate_fsb_count(
#if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */ #if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */
if (nblocks >> (PAGE_CACHE_SHIFT - sbp->sb_blocklog) > ULONG_MAX) if (nblocks >> (PAGE_CACHE_SHIFT - sbp->sb_blocklog) > ULONG_MAX)
return E2BIG; return EFBIG;
#else /* Limited by UINT_MAX of sectors */ #else /* Limited by UINT_MAX of sectors */
if (nblocks << (sbp->sb_blocklog - BBSHIFT) > UINT_MAX) if (nblocks << (sbp->sb_blocklog - BBSHIFT) > UINT_MAX)
return E2BIG; return EFBIG;
#endif #endif
return 0; return 0;
} }
...@@ -393,7 +393,7 @@ xfs_mount_validate_sb( ...@@ -393,7 +393,7 @@ xfs_mount_validate_sb(
xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
xfs_fs_mount_cmn_err(flags, xfs_fs_mount_cmn_err(flags,
"file system too large to be mounted on this system."); "file system too large to be mounted on this system.");
return XFS_ERROR(E2BIG); return XFS_ERROR(EFBIG);
} }
if (unlikely(sbp->sb_inprogress)) { if (unlikely(sbp->sb_inprogress)) {
...@@ -1009,7 +1009,7 @@ xfs_check_sizes(xfs_mount_t *mp) ...@@ -1009,7 +1009,7 @@ xfs_check_sizes(xfs_mount_t *mp)
d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks);
if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) {
cmn_err(CE_WARN, "XFS: size check 1 failed"); cmn_err(CE_WARN, "XFS: size check 1 failed");
return XFS_ERROR(E2BIG); return XFS_ERROR(EFBIG);
} }
error = xfs_read_buf(mp, mp->m_ddev_targp, error = xfs_read_buf(mp, mp->m_ddev_targp,
d - XFS_FSS_TO_BB(mp, 1), d - XFS_FSS_TO_BB(mp, 1),
...@@ -1019,7 +1019,7 @@ xfs_check_sizes(xfs_mount_t *mp) ...@@ -1019,7 +1019,7 @@ xfs_check_sizes(xfs_mount_t *mp)
} else { } else {
cmn_err(CE_WARN, "XFS: size check 2 failed"); cmn_err(CE_WARN, "XFS: size check 2 failed");
if (error == ENOSPC) if (error == ENOSPC)
error = XFS_ERROR(E2BIG); error = XFS_ERROR(EFBIG);
return error; return error;
} }
...@@ -1027,7 +1027,7 @@ xfs_check_sizes(xfs_mount_t *mp) ...@@ -1027,7 +1027,7 @@ xfs_check_sizes(xfs_mount_t *mp)
d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) {
cmn_err(CE_WARN, "XFS: size check 3 failed"); cmn_err(CE_WARN, "XFS: size check 3 failed");
return XFS_ERROR(E2BIG); return XFS_ERROR(EFBIG);
} }
error = xfs_read_buf(mp, mp->m_logdev_targp, error = xfs_read_buf(mp, mp->m_logdev_targp,
d - XFS_FSB_TO_BB(mp, 1), d - XFS_FSB_TO_BB(mp, 1),
...@@ -1037,7 +1037,7 @@ xfs_check_sizes(xfs_mount_t *mp) ...@@ -1037,7 +1037,7 @@ xfs_check_sizes(xfs_mount_t *mp)
} else { } else {
cmn_err(CE_WARN, "XFS: size check 3 failed"); cmn_err(CE_WARN, "XFS: size check 3 failed");
if (error == ENOSPC) if (error == ENOSPC)
error = XFS_ERROR(E2BIG); error = XFS_ERROR(EFBIG);
return error; return error;
} }
} }
......
...@@ -2247,7 +2247,7 @@ xfs_rtmount_init( ...@@ -2247,7 +2247,7 @@ xfs_rtmount_init(
cmn_err(CE_WARN, "XFS: realtime mount -- %llu != %llu", cmn_err(CE_WARN, "XFS: realtime mount -- %llu != %llu",
(unsigned long long) XFS_BB_TO_FSB(mp, d), (unsigned long long) XFS_BB_TO_FSB(mp, d),
(unsigned long long) mp->m_sb.sb_rblocks); (unsigned long long) mp->m_sb.sb_rblocks);
return XFS_ERROR(E2BIG); return XFS_ERROR(EFBIG);
} }
error = xfs_read_buf(mp, mp->m_rtdev_targp, error = xfs_read_buf(mp, mp->m_rtdev_targp,
d - XFS_FSB_TO_BB(mp, 1), d - XFS_FSB_TO_BB(mp, 1),
...@@ -2256,7 +2256,7 @@ xfs_rtmount_init( ...@@ -2256,7 +2256,7 @@ xfs_rtmount_init(
cmn_err(CE_WARN, cmn_err(CE_WARN,
"XFS: realtime mount -- xfs_read_buf failed, returned %d", error); "XFS: realtime mount -- xfs_read_buf failed, returned %d", error);
if (error == ENOSPC) if (error == ENOSPC)
return XFS_ERROR(E2BIG); return XFS_ERROR(EFBIG);
return error; return error;
} }
xfs_buf_relse(bp); xfs_buf_relse(bp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册