Skip to content

Commit 79012cf

Browse files
Panky-codesbrauner
authored andcommitted
xfs: expose block size in stat
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. This change is based on a patch originally from Dave Chinner.[1] [1] https://lwn.net/ml/linux-fsdevel/[email protected]/ Signed-off-by: Pankaj Raghav <[email protected]> Signed-off-by: Luis Chamberlain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Darrick J. Wong <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Daniel Gomez <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent de631e1 commit 79012cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_iops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ xfs_stat_blksize(
567567
return 1U << mp->m_allocsize_log;
568568
}
569569

570-
return PAGE_SIZE;
570+
return max_t(uint32_t, PAGE_SIZE, mp->m_sb.sb_blocksize);
571571
}
572572

573573
STATIC int

0 commit comments

Comments
 (0)