]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix inode reservation space for removing transaction
authorhexiaole <hexiaole@kylinos.cn>
Wed, 24 Aug 2022 14:48:28 +0000 (16:48 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 30 Aug 2022 08:32:54 +0000 (10:32 +0200)
commitd3e53ab7cdc7fabb8c94137e335634e0ed4691e8
tree1b4614c064343efde10e4b7a698f6f6ea195f634
parente4a32219d3d9438e450f4b3e8cf642867ca02391
xfs: fix inode reservation space for removing transaction

Source kernel commit: 031d166f968efba6e4f091ff75d0bb5206bb3918

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 <hexiaole@kylinos.cn>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[djwong: remove redundant code citations]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_trans_resv.c