Re: [PATCH v4 13/27] xfs: Increase rename inode reservation

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

 



On Tue, 2022-10-25 at 12:15 -0700, Darrick J. Wong wrote:
> On Fri, Oct 21, 2022 at 03:29:22PM -0700,
> allison.henderson@xxxxxxxxxx wrote:
> > From: Allison Henderson <allison.henderson@xxxxxxxxxx>
> > 
> > xfs_rename can lock 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 <allison.henderson@xxxxxxxxxx>
> 
> Looks good, I'll add this to the 6.1 fixes.
> Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>
Great, thanks!
Allison
> 
> --D
> 
> > ---
> >  fs/xfs/libxfs/xfs_trans_resv.c | 4 ++--
> >  fs/xfs/xfs_inode.c             | 2 +-
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/xfs/libxfs/xfs_trans_resv.c
> > b/fs/xfs/libxfs/xfs_trans_resv.c
> > index 2c4ad6e4bb14..5b2f27cbdb80 100644
> > --- a/fs/xfs/libxfs/xfs_trans_resv.c
> > +++ b/fs/xfs/libxfs/xfs_trans_resv.c
> > @@ -422,7 +422,7 @@ xfs_calc_itruncate_reservation_minlogsize(
> >  
> >  /*
> >   * In renaming a files we can modify:
> > - *    the four inodes involved: 4 * inode size
> > + *    the five inodes involved: 5 * inode size
> >   *    the two directory btrees: 2 * (max depth + v2) * dir block
> > size
> >   *    the two directory bmap btrees: 2 * max depth * block size
> >   * And the bmap_finish transaction can free dir and bmap blocks
> > (two sets
> > @@ -437,7 +437,7 @@ xfs_calc_rename_reservation(
> >         struct xfs_mount        *mp)
> >  {
> >         return XFS_DQUOT_LOGRES(mp) +
> > -               max((xfs_calc_inode_res(mp, 4) +
> > +               max((xfs_calc_inode_res(mp, 5) +
> >                      xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp),
> >                                       XFS_FSB_TO_B(mp, 1))),
> >                     (xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) +
> > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> > index 71d60885000e..ea7aeab839c2 100644
> > --- a/fs/xfs/xfs_inode.c
> > +++ b/fs/xfs/xfs_inode.c
> > @@ -2848,7 +2848,7 @@ xfs_rename(
> >          * Lock all the participating inodes. Depending upon
> > whether
> >          * the target_name exists in the target directory, and
> >          * whether the target directory is the same as the source
> > -        * directory, we can lock from 2 to 4 inodes.
> > +        * directory, we can lock from 2 to 5 inodes.
> >          */
> >         xfs_lock_inodes(inodes, num_inodes, XFS_ILOCK_EXCL);
> >  
> > -- 
> > 2.25.1
> > 





[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