summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2003-02-19 20:19:52 +0100
committerChristoph Hellwig <hch@lab343.munich.sgi.com>2003-02-19 20:19:52 +0100
commit955bf21e652b4b3e49d85a54cc4d1287594ef3da (patch)
tree4d332e6e6b8e4ffb997f4208973950cb20df3489
parentad479a4b7a5869ad0eb7192ac8fa36f7d20020b8 (diff)
[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
-rw-r--r--fs/xfs/xfs_mount.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index df578881cbcb..6fa2f67a7416 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -272,7 +272,7 @@ xfs_mount_validate_sb(
cmn_err(CE_WARN,
"XFS: Only page-sized (%d) or less blocksizes currently work.",
PAGE_SIZE);
- return XFS_ERROR(EWRONGFS);
+ return XFS_ERROR(ENOSYS);
}
return 0;
@@ -459,10 +459,22 @@ xfs_readsb(xfs_mount_t *mp)
}
/*
- * Re-read the superblock so that our buffer is correctly sized.
- * We only need to do this if sector size on-disk is different.
+ * We must be able to do sector-sized and sector-aligned IO.
+ */
+ 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_relse(bp);
sector_size = mp->m_sb.sb_sectsize;