diff options
author | Wei Yang <richard.weiyang@gmail.com> | 2024-11-16 02:48:03 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2025-01-14 07:40:39 +0100 |
commit | 5f8db8d428807e52c816610e8acea576f856eb6d (patch) | |
tree | 21de323bf4c6ae6c594b535437da8f0e75bba699 | |
parent | filemap: remove unused folio_add_wait_queue (diff) | |
download | linux-5f8db8d428807e52c816610e8acea576f856eb6d.tar.xz linux-5f8db8d428807e52c816610e8acea576f856eb6d.zip |
maple_tree: index has been checked to be smaller than pivot
Patch series "mas_anode_descend() related cleanup".
Some cleanup related to mas_anode_descend().
This patch (of 3):
At the beginning of loop, it has checked the range is in lower bounds.
Link: https://lkml.kernel.org/r/20241116014805.11547-1-richard.weiyang@gmail.com
Link: https://lkml.kernel.org/r/20241116014805.11547-2-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | lib/maple_tree.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 36e603645a30..57603524e2dd 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4882,13 +4882,12 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) found = true; goto done; } - if (mas->index <= pivot) { - mas->node = mas_slot(mas, slots, offset); - mas->min = min; - mas->max = pivot; - offset = 0; - break; - } + + mas->node = mas_slot(mas, slots, offset); + mas->min = min; + mas->max = pivot; + offset = 0; + break; } next_slot: min = pivot + 1; |