Re: [PATCH 1/7] xfs: make sure maxlen is still congruent with prod when rounding down

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

 



On Thu, Oct 12, 2023 at 10:31:46AM -0700, Darrick J. Wong wrote:
> /*
>  * Make sure we don't run off the end of the rt volume.  Be careful that
>  * adjusting maxlen downwards doesn't cause us to fail the alignment checks.
>  */
> static inline xfs_extlen_t
> xfs_rtallocate_clamp_len(
> 	struct xfs_mount	*mp,
> 	xfs_rtblock_t		startrtx,
> 	xfs_extlen_t		rtxlen,
> 	xfs_extlen_t		prod)
> {
> 	xfs_extlen_t		ret;
> 
> 	ret = min(mp->m_sb.sb_rextents, startrtx + rtxlen) - startrtx;
> 	return rounddown(ret, prod);
> }
> 
> 	minlen = xfs_rtallocate_clamp_len(mp, i, maxlen, prod);
> 
> and
> 
> 	minlen = xfs_rtalloc_clamp_len(mp, bno, maxlen, prod);

Looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[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