[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230915183848.1018717-22-kernel@pankajraghav.com>
Date: Fri, 15 Sep 2023 20:38:46 +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,
Dave Chinner <dchinner@...hat.com>
Subject: [RFC 21/23] xfs: expose block size in stat
From: Dave Chinner <dchinner@...hat.com>
For block size larger than page size, the unit of efficient IO is
the block size, not the page size. Leaving stat() to report
PAGE_SIZE as the block size causes test programs like fsx to issue
illegal ranges for operations that require block size alignment
(e.g. fallocate() insert range). Hence update the preferred IO size
to reflect the block size in this case.
Signed-off-by: Dave Chinner <dchinner@...hat.com>
[mcgrof: forward rebase in consideration for commit
dd2d535e3fb29d ("xfs: cleanup calculating the stat optimal I/O size")]
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
fs/xfs/xfs_iops.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 2ededd3f6b8c..080a79a81c46 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -515,6 +515,8 @@ xfs_stat_blksize(
struct xfs_inode *ip)
{
struct xfs_mount *mp = ip->i_mount;
+ unsigned long default_size = max_t(unsigned long, PAGE_SIZE,
+ mp->m_sb.sb_blocksize);
/*
* If the file blocks are being allocated from a realtime volume, then
@@ -543,7 +545,7 @@ xfs_stat_blksize(
return 1U << mp->m_allocsize_log;
}
- return PAGE_SIZE;
+ return default_size;
}
STATIC int
--
2.40.1
Powered by blists - more mailing lists