On Fri, Jun 21, 2024 at 10:05:36AM +0000, John Garry wrote:
For forcealign enabled, the allocation unit size is in ip->i_extsize, andi_extsize is in units of fsblocks, whereas this function returns bytes.
this must never be zero.
Signed-off-by: John Garry<john.g.garry@xxxxxxxxxx>
---
fs/xfs/xfs_inode.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 994fb7e184d9..cd07b15478ac 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -4299,6 +4299,8 @@ xfs_inode_alloc_unitsize(
{
unsigned int blocks = 1;
+ if (xfs_inode_has_forcealign(ip))
+ return ip->i_extsize;
I think you need XFS_FSB_TO_B here?