Commit b4141d36 authored by Long Li's avatar Long Li
Browse files

xfs: only bunmap align in datafork for forcealign

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VTE3


CVE: NA

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

We only need bunmap align in datafork for forcealign, so fix it add
extra datafork check.

Fixes: fed7e6c8 ("xfs: make bunmapi observe forcealigin")
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
parent e6f24808
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5297,7 +5297,7 @@ __xfs_bunmapi(
	isrt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip);
	end = start + len;
	if (xfs_inode_forcealign(ip) && ip->i_d.di_extsize > 1
			&& S_ISREG(VFS_I(ip)->i_mode)) {
		&& S_ISREG(VFS_I(ip)->i_mode) && whichfork == XFS_DATA_FORK) {
		start = roundup_64(start, ip->i_d.di_extsize);
		end = rounddown_64(end, ip->i_d.di_extsize);
		len  = end - start;