Skip to content

Commit

Permalink
[XFS] Don't assert if trying to mount with blocksize > pagesize
Browse files Browse the repository at this point in the history
If we don't do the blocksize/PAGESIZE check before calling
xfs_sb_validate_fsb_count() we can assert if we try to mount with a
blocksize > pagesize. The assert is valid so leave it and just move the
blocksize/pagesize check earlier.

SGI-PV: 983734

SGI-Modid: xfs-linux-melb:xfs-kern:31365a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: David Chinner <dgc@sgi.com>
  • Loading branch information
Lachlan McIlroy authored and Niv Sardi committed Jul 28, 2008
1 parent 8f8670b commit 2edbddd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions fs/xfs/xfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,19 @@ xfs_mount_validate_sb(
return XFS_ERROR(EFSCORRUPTED);
}

/*
* Until this is fixed only page-sized or smaller data blocks work.
*/
if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) {
xfs_fs_mount_cmn_err(flags,
"file system with blocksize %d bytes",
sbp->sb_blocksize);
xfs_fs_mount_cmn_err(flags,
"only pagesize (%ld) or less will currently work.",
PAGE_SIZE);
return XFS_ERROR(ENOSYS);
}

if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) ||
xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) {
xfs_fs_mount_cmn_err(flags,
Expand All @@ -279,19 +292,6 @@ xfs_mount_validate_sb(
return XFS_ERROR(ENOSYS);
}

/*
* Until this is fixed only page-sized or smaller data blocks work.
*/
if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) {
xfs_fs_mount_cmn_err(flags,
"file system with blocksize %d bytes",
sbp->sb_blocksize);
xfs_fs_mount_cmn_err(flags,
"only pagesize (%ld) or less will currently work.",
PAGE_SIZE);
return XFS_ERROR(ENOSYS);
}

return 0;
}

Expand Down

0 comments on commit 2edbddd

Please sign in to comment.