Commit 61dc2920 authored by John Garry's avatar John Garry Committed by Long Li
Browse files

xfs: Update xfs_is_falloc_aligned() mask for forcealign

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VTE3
CVE: NA

Reference: https://lore.kernel.org/all/20240326133813.3224593-1-john.g.garry@oracle.com/



--------------------------------

For when forcealign is enabled, we want the alignment mask to cover an
aligned extent, similar to rtvol.

Signed-off-by: default avatarJohn Garry <john.g.garry@oracle.com>
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
parent 11ed095c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ xfs_is_falloc_aligned(
		}
		mask = XFS_FSB_TO_B(mp, mp->m_sb.sb_rextsize) - 1;
	} else {
		if (xfs_inode_forcealign(ip) && ip->i_d.di_extsize > 1)
			mask = (mp->m_sb.sb_blocksize * ip->i_d.di_extsize) - 1;
		else
			mask = mp->m_sb.sb_blocksize - 1;
	}