Commit 9f989c9455aac417c34af9c505e6b169055251da
1 parent
01e1b69cfc
Exists in
master
and in
7 other branches
[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>
Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff
fs/xfs/xfs_mount.c
... | ... | @@ -268,9 +268,12 @@ |
268 | 268 | sbp->sb_blocklog > XFS_MAX_BLOCKSIZE_LOG || |
269 | 269 | sbp->sb_inodesize < XFS_DINODE_MIN_SIZE || |
270 | 270 | sbp->sb_inodesize > XFS_DINODE_MAX_SIZE || |
271 | + sbp->sb_inodelog < XFS_DINODE_MIN_LOG || | |
272 | + sbp->sb_inodelog > XFS_DINODE_MAX_LOG || | |
273 | + (sbp->sb_blocklog - sbp->sb_inodelog != sbp->sb_inopblog) || | |
271 | 274 | (sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE) || |
272 | 275 | (sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE) || |
273 | - sbp->sb_imax_pct > 100)) { | |
276 | + (sbp->sb_imax_pct > 100 || sbp->sb_imax_pct < 1))) { | |
274 | 277 | cmn_err(CE_WARN, "XFS: SB sanity check 1 failed"); |
275 | 278 | XFS_CORRUPTION_ERROR("xfs_mount_validate_sb(3)", |
276 | 279 | XFS_ERRLEVEL_LOW, mp, sbp); |