Skip to contentSkip to conversation

maple_tree-document-that-last-in-mtree_insert_range-is-inclusive.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 2

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: maple_tree: document that "last" in mtree_insert_range() is inclusive
has been removed from the -mm tree. Its filename was
maple_tree-document-that-last-in-mtree_insert_range-is-inclusive.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Steven Rostedt <[email protected]>
Subject: maple_tree: document that "last" in mtree_insert_range() is inclusive
Date: Tue, 12 May 2026 17:56:23 -0400

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.

---

 lib/maple_tree.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
lib/maple_tree.c renamed from lib/maple_tree.c~maple_tree-document-that-last-in-mtree_insert_range-is-inclusive +5 -2
@@ -5727,13 +5727,16 @@ int mtree_store(struct maple_tree *mt, u
 EXPORT_SYMBOL(mtree_store);
 
 /**
- * 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 range
+ *                        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 = @first + length - 1;
+ *
  * Return: 0 on success, -EEXISTS if the range is occupied, -EINVAL on invalid
  * request, -ENOMEM if memory could not be allocated.
  */

_

Patches currently in -mm which might be from [email protected] are