From 948f31b8771020233b86815cdf0f94d642cde9c0 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Tue, 23 Jun 2020 20:35:09 -0400 Subject: [PATCH] wip: pass 747114 - fix r_mas.max when there is no r_mas.max for skipping data Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 0081213c1a4f..ea43f5591951 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -1397,10 +1397,8 @@ static inline void mas_adopt_children(struct ma_state *mas, child = _mte_get_rcu_slot(parent, slot, type, mas->tree); if (!mt_is_empty(child)) { - printk("set parent of child %p slot %u\n", child, slot); - printk("parent is %p\n", parent); + printk("set %p[%u] to parent of %p\n", parent, slot, child); mte_set_parent(child, parent, slot); - printk("%p parent is %p\n", child, mte_parent(child)); } } } @@ -1557,10 +1555,10 @@ static inline void mab_shift_right(struct maple_big_node *b_node, static inline int mab_calc_split(struct maple_big_node *b_node, int size, unsigned char slot_cnt, unsigned long min) { - int split = (size + 1) / 2; // Assume equal split. + int split = size / 2; // Assume equal split. if (size > 2* slot_cnt) { - split = (size + 2) / 3; + split = (size + 1) / 3; } printk("Guessing leaf split of %u (size is %d)\n", split, size); @@ -2672,6 +2670,8 @@ static inline int mas_spanning_store(struct ma_state *mas, void *entry) mab_mas_cp(&b_node, split + 1, b_end + 1, &r_mas, 0); r_mas.max = b_node.pivot[b_end]; printk("r_mas.max is %lu\n", r_mas.max); + } else { + r_mas.max = l_mas.max; } if (mte_is_leaf(l)) { -- 2.50.1