lkml.org 
[lkml]   [2022]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] maple_tree: Fix sparse reported issues
On Tue, Jul 12, 2022 at 02:24:55PM +0000, Liam Howlett wrote:
> When building with C=1, the maple tree had some rcu type mismatch &
> locking mismatches in the destroy functions. There were cosmetic only
> since this happens after the nodes are removed from the tree.

... in the current use-case. It's a legitimate use of the API to do:

ma_init();
ma_store();
ma_destroy();
ma_store();

Can you add a new test that does that?

> @@ -5524,13 +5526,17 @@ static void mt_destroy_walk(struct maple_enode *enode, unsigned char ma_flags,
>
> type = mte_node_type(mas.node);
> slots = ma_slots(mte_to_node(mas.node), type);
> - if ((offset < mt_slots[type]) && mte_node_type(slots[offset]) &&
> - mte_to_node(slots[offset])) {
> - struct maple_enode *parent = mas.node;
> + if (offset >= mt_slots[type])
> + goto next;
>
> - mas.node = mas_slot_locked(&mas, slots, offset);
> + tmp = mas_slot_locked(&mas, slots, offset);
> + if (mte_node_type(tmp) && mte_to_node(tmp)) {
> +

Unnecessary blank line?

> + parent = mas.node;
> + mas.node = tmp;
> slots = mas_destroy_descend(&mas, parent, offset);
> }
> +next:
> node = mas_mn(&mas);
> } while (start != mas.node);
>
> --
> 2.35.1
>

\
 
 \ /
  Last update: 2022-07-12 16:55    [W:0.189 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site