@@ -131,11 +131,16 @@ xfs_sb_validate_fsb_count(
xfs_sb_t *sbp,
uint64_t nblocks)
{
- ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
ASSERT(sbp->sb_blocklog >= BBSHIFT);
+ unsigned long mapping_count;
+
+ if (sbp->sb_blocklog <= PAGE_SHIFT)
+ mapping_count = nblocks >> (PAGE_SHIFT - sbp->sb_blocklog);
+ else
+ mapping_count = nblocks << (sbp->sb_blocklog - PAGE_SHIFT);
/* Limited by ULONG_MAX of page cache index */
- if (nblocks >> (PAGE_SHIFT - sbp->sb_blocklog) > ULONG_MAX)
+ if (mapping_count > ULONG_MAX)
return -EFBIG;
return 0;
}
@@ -1651,13 +1651,10 @@ xfs_fs_fill_super(
goto out_free_sb;
}
- /*
- * Until this is fixed only page-sized or smaller data blocks work.
- */
- if (mp->m_sb.sb_blocksize > PAGE_SIZE) {
+ if (mp->m_sb.sb_blocksize == (2 * PAGE_SIZE)) {
xfs_warn(mp,
"File system with blocksize %d bytes. "
- "Only pagesize (%ld) or less will currently work.",
+ "Blocksize that is twice the pagesize %ld does not currently work.",
mp->m_sb.sb_blocksize, PAGE_SIZE);
error = -ENOSYS;
goto out_free_sb;