Skip to content

Commit 031d166

Browse files
hexiaoleDarrick J. Wong
hexiaole
authored and
Darrick J. Wong
committed
xfs: fix inode reservation space for removing transaction
In 'fs/xfs/libxfs/xfs_trans_resv.c', the comment for transaction of removing a directory entry writes: /* fs/xfs/libxfs/xfs_trans_resv.c begin */ /* * For removing a directory entry we can modify: * the parent directory inode: inode size * the removed inode: inode size ... xfs_calc_remove_reservation( struct xfs_mount *mp) { return XFS_DQUOT_LOGRES(mp) + xfs_calc_iunlink_add_reservation(mp) + max((xfs_calc_inode_res(mp, 1) + ... /* fs/xfs/libxfs/xfs_trans_resv.c end */ There has 2 inode size of space to be reserverd, but the actual code for inode reservation space writes. There only count for 1 inode size to be reserved in 'xfs_calc_inode_res(mp, 1)', rather than 2. Signed-off-by: hexiaole <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> [djwong: remove redundant code citations] Signed-off-by: Darrick J. Wong <[email protected]>
1 parent d621133 commit 031d166

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/libxfs/xfs_trans_resv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ xfs_calc_remove_reservation(
515515
{
516516
return XFS_DQUOT_LOGRES(mp) +
517517
xfs_calc_iunlink_add_reservation(mp) +
518-
max((xfs_calc_inode_res(mp, 1) +
518+
max((xfs_calc_inode_res(mp, 2) +
519519
xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
520520
XFS_FSB_TO_B(mp, 1))),
521521
(xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) +

0 commit comments

Comments
 (0)