From patchwork Mon Dec 18 04:57:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13496184 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F3E063A3 for ; Mon, 18 Dec 2023 04:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="1a8V6Hf9" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=RcOyIBpxZIGmnqrcm9Igk5aXwyiHQLpr2UMoBuy+kTo=; b=1a8V6Hf9SsjMw2Ifu4eBgI+lCm IxNqFgh6NVRhPN+wBUkmEbAd6+M0uSdWZMrpyPMjHyPCtqv4ENPqYLN6qbQTsCZmx0c6pMcNVf/97 qTf/3KHvu6Aq/9THx02ZQid753qsuFd8HuaC9p5cF7XS8Ko9PhDNAKXZoJOtuKsOL+aBjYDJimqOB jIwFLvXajpoZB8nP8zddQGPQIuAdebGctlq5vA4i3v6CYbSIzCsfBKzznIvYepWcJYC5Q2wuH8oRS QEKIVND+LTvGBPt4CEOm0xJcexmeUYYrTZcDlVTpPHUkeCEUtTdhfTPqXZy/bEG/g1O1z4WY+uZis 25wFDu8g==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rF5hG-00956T-0M; Mon, 18 Dec 2023 04:57:42 +0000 From: Christoph Hellwig To: Chandan Babu R Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: [PATCH 01/22] xfs: consider minlen sized extents in xfs_rtallocate_extent_block Date: Mon, 18 Dec 2023 05:57:17 +0100 Message-Id: <20231218045738.711465-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231218045738.711465-1-hch@lst.de> References: <20231218045738.711465-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 Reviewed-by: Darrick J. Wong --- 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 */ /*