]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Fix range add to empty tree.
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 13 Mar 2019 15:56:15 +0000 (11:56 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 31 Jul 2019 14:52:41 +0000 (10:52 -0400)
When adding to an empty tree, use the encoded node to set the pivot.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index 8a53c362b56176e9342da4067846e952e6472472..f3d02e47812269363a29b3f4a04ee8bd0a31d24c 100644 (file)
@@ -1211,7 +1211,7 @@ static inline void ma_root_expand(struct ma_state *ms, void *entry)
        /* Assign the old entry to slot 0, or set it to null. */
        ma_set_rcu_slot(mn, 0, r_entry);
        if (!r_entry)
-               ma_set_pivot(mn, 0, ms->index - 1);
+               ma_set_pivot(ms->node, 0, ms->index - 1);
 
        _ma_insert(ms, entry, 1);
        if (mas_is_err(ms))