Commit 11ed095c authored by Long Li's avatar Long Li
Browse files

xfs: fix set xflags fail when inode has extent hit

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


CVE: NA

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

Since introduce "fs: xfs: Introduce FORCEALIGN inode flag", generic/079
report fail, the reason is that vfs_ioc_fssetxattr_check() would clear
FS_XFLAG_EXTSIZE and FS_XFLAG_EXTSZINHERIT due to fa not update
completely.

Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
parent 3f1c8c93
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1649,6 +1649,10 @@ xfs_ioc_setxflags(
	}

	xfs_fill_fsxattr(ip, false, &old_fa);
	fa.fsx_extsize = old_fa.fsx_extsize;
	fa.fsx_cowextsize = old_fa.fsx_cowextsize;
	fa.fsx_projid = old_fa.fsx_projid;
	fa.fsx_nextents = old_fa.fsx_nextents;
	error = vfs_ioc_fssetxattr_check(VFS_I(ip), &old_fa, &fa);
	if (error) {
		xfs_trans_cancel(tp);