Skip to content

Commit e942498

Browse files
Long Licmaiolino
authored andcommitted
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: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Long Li <leo.lilong@huawei.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent e596609 commit e942498

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/xfs/xfs_inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,8 @@ xfs_itruncate_extents_flags(
10481048
xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
10491049
if (icount_read(VFS_I(ip)))
10501050
xfs_assert_ilocked(ip, XFS_IOLOCK_EXCL);
1051-
ASSERT(new_size <= XFS_ISIZE(ip));
1051+
if (whichfork == XFS_DATA_FORK)
1052+
ASSERT(new_size <= XFS_ISIZE(ip));
10521053
ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
10531054
ASSERT(ip->i_itemp != NULL);
10541055
ASSERT(ip->i_itemp->ili_lock_flags == 0);

0 commit comments

Comments
 (0)