Skip to contentSkip to conversation

Don't assert if trying to mount with blocksize > pagesize

PATCH In review Lachlan McIlroy 3 participants 3 messages Jun 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't assert if trying to mount with blocksize > pagesize

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.

xfs/xfs_mount.c renamed from xfs/xfs_mount.c_1.436 +0 -0
@@ -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,
@@ -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;
}
#1 lore raw
Quoted 5 lines · Lachlan McIlroy

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.

Yes, looks like a problem. The fix looks ok.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#2 lore raw
In reply to Lachlan McIlroy
Quoted 5 lines · Lachlan McIlroy

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.

The patch looks good, but the subject is rather misleading, it should rather be something like:

"move check for blocksize > pagesize later in the mount path"