* [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node()
@ 2023-03-07 16:03 Peng Zhang
2023-03-07 16:21 ` Greg KH
2023-03-09 1:55 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Peng Zhang @ 2023-03-07 16:03 UTC (permalink / raw)
To: Liam.Howlett, snild
Cc: linux-mm, linux-kernel, maple-tree, Stable, Peng Zhang
The assignment of mas->min and mas->max is wrong. mas->min and mas->max
should represent the range of the current node. After mas_ascend()
returns, mas-min and mas->max already represent the range of the current
node, so we should delete these assignments of mas->min and mas->max.
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
---
lib/maple_tree.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index f5bee48de569..d4ddf7f8adc7 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -5157,9 +5157,6 @@ static inline bool mas_rewind_node(struct ma_state *mas)
*/
static inline bool mas_skip_node(struct ma_state *mas)
{
- unsigned long *pivots;
- enum maple_type mt;
-
if (mas_is_err(mas))
return false;
@@ -5173,14 +5170,7 @@ static inline bool mas_skip_node(struct ma_state *mas)
mas_ascend(mas);
}
} while (mas->offset >= mas_data_end(mas));
-
- mt = mte_node_type(mas->node);
- pivots = ma_pivots(mas_mn(mas), mt);
- mas->min = pivots[mas->offset] + 1;
mas->offset++;
- if (mas->offset < mt_slots[mt])
- mas->max = pivots[mas->offset];
-
return true;
}
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node()
2023-03-07 16:03 [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node() Peng Zhang
@ 2023-03-07 16:21 ` Greg KH
2023-03-09 1:55 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-03-07 16:21 UTC (permalink / raw)
To: Peng Zhang
Cc: Liam.Howlett, snild, linux-mm, linux-kernel, maple-tree, Stable
On Wed, Mar 08, 2023 at 12:03:40AM +0800, Peng Zhang wrote:
> The assignment of mas->min and mas->max is wrong. mas->min and mas->max
> should represent the range of the current node. After mas_ascend()
> returns, mas-min and mas->max already represent the range of the current
> node, so we should delete these assignments of mas->min and mas->max.
>
> Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
> ---
> lib/maple_tree.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index f5bee48de569..d4ddf7f8adc7 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -5157,9 +5157,6 @@ static inline bool mas_rewind_node(struct ma_state *mas)
> */
> static inline bool mas_skip_node(struct ma_state *mas)
> {
> - unsigned long *pivots;
> - enum maple_type mt;
> -
> if (mas_is_err(mas))
> return false;
>
> @@ -5173,14 +5170,7 @@ static inline bool mas_skip_node(struct ma_state *mas)
> mas_ascend(mas);
> }
> } while (mas->offset >= mas_data_end(mas));
> -
> - mt = mte_node_type(mas->node);
> - pivots = ma_pivots(mas_mn(mas), mt);
> - mas->min = pivots[mas->offset] + 1;
> mas->offset++;
> - if (mas->offset < mt_slots[mt])
> - mas->max = pivots[mas->offset];
> -
> return true;
> }
>
> --
> 2.20.1
>
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node()
2023-03-07 16:03 [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node() Peng Zhang
2023-03-07 16:21 ` Greg KH
@ 2023-03-09 1:55 ` Andrew Morton
2023-03-09 2:09 ` Peng Zhang
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2023-03-09 1:55 UTC (permalink / raw)
To: Peng Zhang
Cc: Liam.Howlett, snild, linux-mm, linux-kernel, maple-tree, Stable
On Wed, 8 Mar 2023 00:03:40 +0800 Peng Zhang <zhangpeng.00@bytedance.com> wrote:
> The assignment of mas->min and mas->max is wrong. mas->min and mas->max
> should represent the range of the current node. After mas_ascend()
> returns, mas-min and mas->max already represent the range of the current
> node, so we should delete these assignments of mas->min and mas->max.
>
Please fully describe the user-visible effects of the flaw, especially
when proposing a -stable backport.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node()
2023-03-09 1:55 ` Andrew Morton
@ 2023-03-09 2:09 ` Peng Zhang
0 siblings, 0 replies; 4+ messages in thread
From: Peng Zhang @ 2023-03-09 2:09 UTC (permalink / raw)
To: Andrew Morton
Cc: Liam.Howlett, snild, linux-mm, linux-kernel, maple-tree, Stable
在 2023/3/9 09:55, Andrew Morton 写道:
> On Wed, 8 Mar 2023 00:03:40 +0800 Peng Zhang <zhangpeng.00@bytedance.com> wrote:
>
>> The assignment of mas->min and mas->max is wrong. mas->min and mas->max
>> should represent the range of the current node. After mas_ascend()
>> returns, mas-min and mas->max already represent the range of the current
>> node, so we should delete these assignments of mas->min and mas->max.
>>
> Please fully describe the user-visible effects of the flaw, especially
> when proposing a -stable backport.
>
The fixes made by this patch have been included in
https://lore.kernel.org/lkml/20230307180247.2220303-2-Liam.Howlett@oracle.com/,
so please don't pay attention.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-09 2:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07 16:03 [PATCH] maple_tree: Fix the error of mas->min/max in mas_skip_node() Peng Zhang
2023-03-07 16:21 ` Greg KH
2023-03-09 1:55 ` Andrew Morton
2023-03-09 2:09 ` Peng Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox