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>