maple_tree: arange64 node is not a leaf node
Subsystems (2)
PATCH 1/2 maple_tree: arange64 node is not a leaf node
mt_dump_arange64() only applies to an entry whose type is maple_arange_64, in which mte_is_leaf() must return false.
Since mte_is_leaf() here is always false, we can remove this condition check.
--- lib/maple_tree.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
lib/maple_tree.c +1 -5
@@ -7177,7 +7177,6 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry, enum mt_dump_format format) {struct maple_arange_64 *node = &mte_to_node (entry)->ma64; -bool leaf =mte_is_leaf (entry);unsigned long first = min;int i;
@@ -7211,10 +7210,7 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry,break ;if (last ==0 && i >0 )break ; -if (leaf) -mt_dump_entry (mt_slot (mt, node->slot, i), - first, last, depth +1 , format); -else if (node->slot[i]) +if (node->slot[i])mt_dump_node (mt,mt_slot (mt, node->slot, i), first, last, depth +1 , format);
Signature · 1 line
2.34.1
PATCH 2/2 maple_tree: dump error message based on format
Just do what mt_dump_range64() does.
Dump the error message based on format.
--- lib/maple_tree.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
lib/maple_tree.c +8 -2
@@ -7217,9 +7217,15 @@ static void mt_dump_arange64(const struct maple_tree *mt, void *entry,if (last == max)break ;if (last > max) { -pr_err ("node %p last (%lu) > max (%lu) at pivot %d!\n" , +switch (format) { +case mt_dump_hex: +pr_err ("node %p last (%lx) > max (%lx) at pivot %d!\n" , node, last, max, i); -break ; +break ; +case mt_dump_dec: +pr_err ("node %p last (%lu) > max (%lu) at pivot %d!\n" , + node, last, max, i); + } } first = last +1 ; }
Signature · 1 line
2.34.1
Andrew Morton
maintainerQuoted 6 lines · On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <[email protected]> wrote:
mt_dump_arange64()only applies to an entry whose type ismaple_arange_64, in whichmte_is_leaf()must return false.Since
mte_is_leaf()here is always false, we can remove this condition check.
These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
Please do cc linux-mm on maple-tree changes.
Quoted 5 lines · Andrew Morton
Quoted 3 lines · On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <[email protected]> wrote:
mt_dump_arange64()only applies to an entry whose type ismaple_arange_64, in whichmte_is_leaf()must return false.
Quoted 7 lines
Quoted 3 lines
Since
mte_is_leaf()here is always false, we can remove this condition check.These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
Please do cc linux-mm on maple-tree changes.
Sure, will cc linux-mm next time.
Signature · 2 lines
Wei Yang Help you, Help me
Liam R. Howlett
Reviewed-byQuoted 11 lines · Andrew Morton
Quoted 6 lines · On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <[email protected]> wrote:
mt_dump_arange64()only applies to an entry whose type ismaple_arange_64, in whichmte_is_leaf()must return false.Since
mte_is_leaf()here is always false, we can remove this condition check.These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
Let's make it official then.
Quoted 10 lines · Liam R. Howlett
Quoted 9 lines · Andrew Morton
Quoted 6 lines · On Mon, 26 Aug 2024 01:24:21 +0000 Wei Yang <[email protected]> wrote:
mt_dump_arange64()only applies to an entry whose type ismaple_arange_64, in whichmte_is_leaf()must return false.Since
mte_is_leaf()here is always false, we can remove this condition check.
Quoted 6 lines
Quoted 2 lines
These are pretty simple so I'll say lack-of-a-nack-is-an-ack ;)
Let's make it official then.
Reviewed-by Liam R. Howlett <[email protected]>
Thanks
Signature · 2 lines
Wei Yang Help you, Help me