Re: [PATCH v2] libxfs: fix inode reservation space for removing transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 15, 2022 at 10:54:58AM +0800, Xiaole He wrote:
> From: hexiaole <hexiaole@xxxxxxxxxx>
> 
> In 'libxfs/xfs_trans_resv.c', the comment for transaction of removing a
> directory entry mentions that there has 2 inode size of space to be
> reserverd, but the actual code only count for 1 inode size:

Already merged, see 6.0-rc1.

--D

> 
> /* 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) +
> ...
> /* libxfs/xfs_trans_resv.c end */
> 
> Here only count for 1 inode size to be reserved in
> 'xfs_calc_inode_res(mp, 1)', rather than 2.
> 
> Signed-off-by: hexiaole <hexiaole@xxxxxxxxxx>
> ---
> V1 -> V2: djwong: remove redundant code citations
> 
>  libxfs/xfs_trans_resv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libxfs/xfs_trans_resv.c b/libxfs/xfs_trans_resv.c
> index d4a9f69e..797176d7 100644
> --- a/libxfs/xfs_trans_resv.c
> +++ b/libxfs/xfs_trans_resv.c
> @@ -514,7 +514,7 @@ xfs_calc_remove_reservation(
>  {
>  	return XFS_DQUOT_LOGRES(mp) +
>  		xfs_calc_iunlink_add_reservation(mp) +
> -		max((xfs_calc_inode_res(mp, 1) +
> +		max((xfs_calc_inode_res(mp, 2) +
>  		     xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
>  				      XFS_FSB_TO_B(mp, 1))),
>  		    (xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) +
> -- 
> 2.27.0
> 



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux