[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230915183848.1018717-23-kernel@pankajraghav.com>
Date: Fri, 15 Sep 2023 20:38:47 +0200
From: Pankaj Raghav <kernel@...kajraghav.com>
To: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc: p.raghav@...sung.com, david@...morbit.com, da.gomez@...sung.com,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
willy@...radead.org, djwong@...nel.org, linux-mm@...ck.org,
chandan.babu@...cle.com, mcgrof@...nel.org, gost.dev@...sung.com
Subject: [RFC 22/23] xfs: enable block size larger than page size support
From: Pankaj Raghav <p.raghav@...sung.com>
Currently we don't support blocksize that is twice the page size due to
the limitation of having at least three pages in a large folio[1].
[1] https://lore.kernel.org/all/ZH0GvxAdw1RO2Shr@casper.infradead.org/
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
---
fs/xfs/xfs_mount.c | 9 +++++++--
fs/xfs/xfs_super.c | 7 ++-----
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index aed5be5508fe..4272898c508a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -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;
}
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 1f77014c6e1a..75bf4d23051c 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -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;
--
2.40.1
Powered by blists - more mailing lists