xfs: fix xfs_rename_space_res for non-pptr filesystems

We don't need to reserve space for a parent pointer update for an
existing target if parent pointers are disabled.  Fix this regression
(which LOLLM noticed) so that rename reservations go back to what they
were before parent pointers.

Cc: stable@vger.kernel.org # v6.10
Fixes: 5a8338c882 ("xfs: Add parent pointers to rename")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Darrick J. Wong 2026-09-22 22:58:55 -07:00 committed by Carlos Maiolino
parent 035d27cb2a
commit a800b92634

View File

@ -127,10 +127,10 @@ xfs_rename_space_res(
if (has_whiteout)
ret += xfs_parent_calc_space_res(mp, src_namelen);
ret += 2 * xfs_parent_calc_space_res(mp, target_namelen);
}
if (target_exists)
ret += xfs_parent_calc_space_res(mp, target_namelen);
if (target_exists)
ret += xfs_parent_calc_space_res(mp, target_namelen);
}
return ret;
}