Commit 955bf21e authored by Nathan Scott's avatar Nathan Scott Committed by Christoph Hellwig

[XFS] Extra check on the mount path - ensure we don't attempt to mount XFS fs's

with sector sizes smaller than those the device supports.  Tripped a BUG
in pagebuf, should now be resolved.

SGI Modid: 2.5.x-xfs:slinx:139328a
parent ad479a4b
...@@ -272,7 +272,7 @@ xfs_mount_validate_sb( ...@@ -272,7 +272,7 @@ xfs_mount_validate_sb(
cmn_err(CE_WARN, cmn_err(CE_WARN,
"XFS: Only page-sized (%d) or less blocksizes currently work.", "XFS: Only page-sized (%d) or less blocksizes currently work.",
PAGE_SIZE); PAGE_SIZE);
return XFS_ERROR(EWRONGFS); return XFS_ERROR(ENOSYS);
} }
return 0; return 0;
...@@ -459,10 +459,22 @@ xfs_readsb(xfs_mount_t *mp) ...@@ -459,10 +459,22 @@ xfs_readsb(xfs_mount_t *mp)
} }
/* /*
* Re-read the superblock so that our buffer is correctly sized. * We must be able to do sector-sized and sector-aligned IO.
* We only need to do this if sector size on-disk is different. */
if (sector_size > mp->m_sb.sb_sectsize) {
cmn_err(CE_WARN,
"XFS: device supports only %u byte sectors (not %u)",
sector_size, mp->m_sb.sb_sectsize);
XFS_BUF_UNMANAGE(bp);
xfs_buf_relse(bp);
return XFS_ERROR(ENOSYS);
}
/*
* If device sector size is smaller than the superblock size,
* re-read the superblock so the buffer is correctly sized.
*/ */
if (sector_size != mp->m_sb.sb_sectsize) { if (sector_size < mp->m_sb.sb_sectsize) {
XFS_BUF_UNMANAGE(bp); XFS_BUF_UNMANAGE(bp);
xfs_buf_relse(bp); xfs_buf_relse(bp);
sector_size = mp->m_sb.sb_sectsize; sector_size = mp->m_sb.sb_sectsize;
......
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