Re: [PATCH 01/19] xfs: consider minlen sized extents in xfs_rtallocate_extent_block

Darrick J. Wong
2023-12-14T21:02:44Z

On Thu, Dec 14, 2023 at 07:34:20AM +0100, Christoph Hellwig wrote:
> minlen is the lower bound on the extent length that the caller can
> accept, and maxlen is at this point the maximal available length.
> This means a minlen extent is perfectly fine to use, so do it. This
> matches the equivalent logic in xfs_rtallocate_extent_exact that also
> accepts a minlen sized extent.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
> fs/xfs/xfs_rtalloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
> index 8feb58c6241ce4..fe98a96a26484f 100644
> --- a/fs/xfs/xfs_rtalloc.c
> +++ b/fs/xfs/xfs_rtalloc.c
> @@ -309,7 +309,7 @@ xfs_rtallocate_extent_block(
> /*
> * Searched the whole thing & didn't find a maxlen free extent.
> */
> - if (minlen < maxlen && besti != -1) {
> + if (minlen <= maxlen && besti != -1) {
> xfs_rtxlen_t p; /* amount to trim length by */
>
> /*
> --
> 2.39.2
>
>