From nobody Fri Jun 12 20:23:15 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CF3C833DED5 for ; Tue, 12 May 2026 21:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778622983; cv=none; b=OLnnIcqWS+aHZ5RKOjP4KVhPKv0nr1NSsXIqSP7LAf9B5vzTCtGQTcZXDrAIWnIEpoAq5TOPSxwRtjgGkhW1MBhsOMsOCZGYmSPac+T0WD+i21cVbIyLJQqHOSJ1VJLAjT0nDeMLUf7HPDwaEkTshfq2ZNkNBZC3jtXt8vELkic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778622983; c=relaxed/simple; bh=h1w6hB46AHpBHNXF0FWF92Hbuco+k6+hO1jwKtnHQBg=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=RNrdO5TFFTdqx/vs7fHFaWa4gcjvjDy+EXYJDopUSYv3bFh6YAvFHX0B0gwkUdci2bRYqn+9zYUomOU//eBUCzOFAVHj97jVPqn8AdAVh5IzxISEwTlaFGWR7siezichIpudmLujAGskxkINoMprry9rieokxFOvxIES6CTlD6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=p0ePpw6j; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="p0ePpw6j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51285C2BCB0; Tue, 12 May 2026 21:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778622983; bh=h1w6hB46AHpBHNXF0FWF92Hbuco+k6+hO1jwKtnHQBg=; h=Date:From:To:Subject:From; b=p0ePpw6jqbmaM2sqbiT+MSvclKt1dWKliUKxPWlqpmK9yB/7g/dE7p/6BTXw2m0FF iVuO6mmrPIHpx5GmbbgfpSNqHwvGkpYTfb0lcBxMfpVcI2FvkJiUvJdQHjEA0NRc1g A2Uyb8wHUeTMDZAW/WWhpg7X3GNfyjW1GezIGXbPSJ5iv/yXeiJMugG2knZzvlHWN5 9GKRL0pfUpC9QMoc0t4ev9iSGgRs2+INyTGbhpfIAp9/BI3FeLyfV288+u5+4DWaoe M2whWEk9mTm2Ik8zqTt+8OxzSUqhJoQuXb9lf+vUrQNsBXR3/biTRD1e+zUATNntdA X8crg4xADU9Kw== Date: Tue, 12 May 2026 17:56:23 -0400 From: Steven Rostedt To: "Liam R. Howlett" , LKML , linux-mm@kvack.org, Alice Ryhl , Andrew Ballance , maple-tree@lists.infradead.org, Andrew Morton , Matthew Wilcox , SeongJae Park Subject: [PATCH v2] maple_tree: document that "last" in mtree_insert_range() is inclusive Message-ID: <20260512175623.4c5ca8d2@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Steven Rostedt The kernel doc of mtree_insert_range() does not state if the address represented by the "last" parameter is inclusive or exclusive. This can lead to bugs by code that assumes it is exclusive. Explicitly state that the parameter is inclusive. Signed-off-by: Steven Rostedt Acked-by: SeongJae Park Reviewed-by: "Liam R. Howlett" --- Changes since v1: https://patch.msgid.link/20260506105218.2d027cc0@fedora - Use "(inclusive)" instead of adding '[' ']' around "end". (Alice Ryhl) - Add "from [first, last]" in the short description. (Liam Howlett) lib/maple_tree.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index d18d7ed9ab67..7f6c9b729a1a 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5727,13 +5727,16 @@ int mtree_store(struct maple_tree *mt, unsigned lon= g index, void *entry, EXPORT_SYMBOL(mtree_store); =20 /** - * mtree_insert_range() - Insert an entry at a given range if there is no = value. + * mtree_insert_range() - Insert an entry from [first, last] at a given ra= nge + * if there is no value. * @mt: The maple tree * @first: The start of the range - * @last: The end of the range + * @last: The end of the range (inclusive) * @entry: The entry to store * @gfp: The GFP_FLAGS to use for allocations. * + * Note that @last is inclusive. That is, @last =3D @first + length - 1; + * * Return: 0 on success, -EEXISTS if the range is occupied, -EINVAL on inv= alid * request, -ENOMEM if memory could not be allocated. */ --=20 2.53.0