summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-14 13:29:32 +1100
committerNathan Scott <nathans@sgi.com>2006-03-14 13:29:32 +1100
commit9f989c9455aac417c34af9c505e6b169055251da (patch)
tree59f136ea281ba498bdd674e1b4428d0f53294898
parent01e1b69cfcdcfdd5b405165eaba29428f8b18a7c (diff)
downloadlinux-3.10-9f989c9455aac417c34af9c505e6b169055251da.tar.gz
linux-3.10-9f989c9455aac417c34af9c505e6b169055251da.tar.bz2
linux-3.10-9f989c9455aac417c34af9c505e6b169055251da.zip
[XFS] Additional mount time superblock validation checks.
SGI-PV: 950491 SGI-Modid: xfs-linux-melb:xfs-kern:25354a Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/xfs_mount.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index d62aee02736..20e8abc16d1 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -268,9 +268,12 @@ xfs_mount_validate_sb(
sbp->sb_blocklog > XFS_MAX_BLOCKSIZE_LOG ||
sbp->sb_inodesize < XFS_DINODE_MIN_SIZE ||
sbp->sb_inodesize > XFS_DINODE_MAX_SIZE ||
+ sbp->sb_inodelog < XFS_DINODE_MIN_LOG ||
+ sbp->sb_inodelog > XFS_DINODE_MAX_LOG ||
+ (sbp->sb_blocklog - sbp->sb_inodelog != sbp->sb_inopblog) ||
(sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE) ||
(sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE) ||
- sbp->sb_imax_pct > 100)) {
+ (sbp->sb_imax_pct > 100 || sbp->sb_imax_pct < 1))) {
cmn_err(CE_WARN, "XFS: SB sanity check 1 failed");
XFS_CORRUPTION_ERROR("xfs_mount_validate_sb(3)",
XFS_ERRLEVEL_LOW, mp, sbp);