[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240226094936.2677493-12-kernel@pankajraghav.com>
Date: Mon, 26 Feb 2024 10:49:34 +0100
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
david@...morbit.com,
chandan.babu@...cle.com,
akpm@...ux-foundation.org,
mcgrof@...nel.org,
ziy@...dia.com,
hare@...e.de,
djwong@...nel.org,
gost.dev@...sung.com,
linux-mm@...ck.org,
willy@...radead.org,
Dave Chinner <dchinner@...hat.com>
Subject: [PATCH 11/13] 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>
dd2d535e3fb29d ("xfs: cleanup calculating the stat optimal I/O size")]
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
fs/xfs/xfs_iops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index a0d77f5f512e..1b4edfad464f 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -543,7 +543,7 @@ xfs_stat_blksize(
return 1U << mp->m_allocsize_log;
}
- return PAGE_SIZE;
+ return max_t(unsigned long, PAGE_SIZE, mp->m_sb.sb_blocksize);
}
STATIC int
--
2.43.0
Powered by blists - more mailing lists