]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Load safe root to mas->node in encoded_parent
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 25 Jan 2019 20:43:38 +0000 (15:43 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Fri, 30 Oct 2020 18:55:20 +0000 (14:55 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/maple_tree.c

index ac1d55a15314b9b6f168c79b3dc3cdf6300c8af2..0e87a093f137d5fc4c97e6ebc2def616df267dee 100644 (file)
@@ -191,7 +191,7 @@ static inline void ma_encoded_parent(struct ma_state *mas)
        unsigned char slot;
 
        if (ma_is_root(mt_to_node(mas->node)->parent)) {
-               mas->node = rcu_dereference(mas->tree->ma_root);
+               mas->node = mt_safe_root(rcu_dereference(mas->tree->ma_root));
                return;
        }
 
@@ -513,7 +513,6 @@ static int ma_split(struct ma_state *mas, unsigned char slot,
 
        if (ma_is_root(full)) {
                old_parent = full;
-               mas->node = mt_safe_root(mas->node);
        } else {
                old_parent = mt_parent(mas->node);
                p_end = ma_data_end_r64(&old_parent->mr64, UINT_MAX);