Commit e9424983 authored by Long Li's avatar Long Li Committed by Carlos Maiolino
Browse files

xfs: only assert new size for datafork during truncate extents



The assertion functions properly because we currently only truncate the
attr to a zero size. Any other new size of the attr is not preempted.
Make this assertion is specific to the datafork, preparing for
subsequent patches to truncate the attribute to a non-zero size.

Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent e5966096
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1048,6 +1048,7 @@ xfs_itruncate_extents_flags(
	xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
	if (icount_read(VFS_I(ip)))
		xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL);
	if (whichfork == XFS_DATA_FORK)
		ASSERT(new_size <= XFS_ISIZE(ip));
	ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
	ASSERT(ip->i_itemp != NULL);