Skip to content

Commit e07ee6f

Browse files
allisonhendersonDarrick J. Wong
authored andcommitted
xfs: increase rename inode reservation
xfs_rename can update up to 5 inodes: src_dp, target_dp, src_ip, target_ip and wip. So we need to increase the inode reservation to match. Signed-off-by: Allison Henderson <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent d08af40 commit e07ee6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fs/xfs/libxfs/xfs_trans_resv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ xfs_calc_itruncate_reservation_minlogsize(
422422

423423
/*
424424
* In renaming a files we can modify:
425-
* the four inodes involved: 4 * inode size
425+
* the five inodes involved: 5 * inode size
426426
* the two directory btrees: 2 * (max depth + v2) * dir block size
427427
* the two directory bmap btrees: 2 * max depth * block size
428428
* And the bmap_finish transaction can free dir and bmap blocks (two sets
@@ -437,7 +437,7 @@ xfs_calc_rename_reservation(
437437
struct xfs_mount *mp)
438438
{
439439
return XFS_DQUOT_LOGRES(mp) +
440-
max((xfs_calc_inode_res(mp, 4) +
440+
max((xfs_calc_inode_res(mp, 5) +
441441
xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp),
442442
XFS_FSB_TO_B(mp, 1))),
443443
(xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) +

fs/xfs/xfs_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,7 @@ xfs_rename(
28182818
* Lock all the participating inodes. Depending upon whether
28192819
* the target_name exists in the target directory, and
28202820
* whether the target directory is the same as the source
2821-
* directory, we can lock from 2 to 4 inodes.
2821+
* directory, we can lock from 2 to 5 inodes.
28222822
*/
28232823
xfs_lock_inodes(inodes, num_inodes, XFS_ILOCK_EXCL);
28242824

0 commit comments

Comments
 (0)