mbox series

[v2,0/3] Some fixes and cleanup for maple tree.

Message ID 20230314124203.91572-1-zhangpeng.00@bytedance.com (mailing list archive)
Headers show
Series Some fixes and cleanup for maple tree. | expand

Message

Peng Zhang March 14, 2023, 12:42 p.m. UTC
Some fixes and clean up for maple tree.

The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some
coincidences, because now the implementation of mtree_lookup_walk() scans
pivots one by one and exits the loop early. The test cases for the bugs fixed by
[PATCH v2 3/3] are difficult to write. If I think of how to write them later,
I will send them out. So I send out the second edition first.

Changes since v1:
 - drop [PATCH 4/4]
 - update the commit message of [PATCH 2/4]
 - collect Reviewed-bys
 - add fixes tags

Peng Zhang (3):
  maple_tree: Fix get wrong data_end in mtree_lookup_walk()
  maple_tree: Simplify mas_wr_node_walk()
  maple_tree: Fix a potential concurrency bug in RCU mode

 lib/maple_tree.c | 52 ++++++++++--------------------------------------
 1 file changed, 11 insertions(+), 41 deletions(-)

Comments

Peng Zhang April 4, 2023, 7:56 a.m. UTC | #1
Kindly ping.

在 2023/3/14 20:42, Peng Zhang 写道:
> Some fixes and clean up for maple tree.
>
> The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some
> coincidences, because now the implementation of mtree_lookup_walk() scans
> pivots one by one and exits the loop early. The test cases for the bugs fixed by
> [PATCH v2 3/3] are difficult to write. If I think of how to write them later,
> I will send them out. So I send out the second edition first.
>
> Changes since v1:
>   - drop [PATCH 4/4]
>   - update the commit message of [PATCH 2/4]
>   - collect Reviewed-bys
>   - add fixes tags
>
> Peng Zhang (3):
>    maple_tree: Fix get wrong data_end in mtree_lookup_walk()
>    maple_tree: Simplify mas_wr_node_walk()
>    maple_tree: Fix a potential concurrency bug in RCU mode
>
>   lib/maple_tree.c | 52 ++++++++++--------------------------------------
>   1 file changed, 11 insertions(+), 41 deletions(-)
>
Andrew Morton April 4, 2023, 8:27 p.m. UTC | #2
On Tue, 14 Mar 2023 20:42:00 +0800 Peng Zhang <zhangpeng.00@bytedance.com> wrote:

> Some fixes and clean up for maple tree.
> 
> The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some
> coincidences, because now the implementation of mtree_lookup_walk() scans
> pivots one by one and exits the loop early. The test cases for the bugs fixed by
> [PATCH v2 3/3] are difficult to write. If I think of how to write them later,
> I will send them out. So I send out the second edition first.

Do we feel that any of these should be backported into -stable kernels?
[3/3] looks to be a candidate for this?
Liam R. Howlett April 5, 2023, 12:49 a.m. UTC | #3
* Andrew Morton <akpm@linux-foundation.org> [230404 16:27]:
> On Tue, 14 Mar 2023 20:42:00 +0800 Peng Zhang <zhangpeng.00@bytedance.com> wrote:
> 
> > Some fixes and clean up for maple tree.
> > 
> > The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some
> > coincidences, because now the implementation of mtree_lookup_walk() scans
> > pivots one by one and exits the loop early. The test cases for the bugs fixed by
> > [PATCH v2 3/3] are difficult to write. If I think of how to write them later,
> > I will send them out. So I send out the second edition first.
> 
> Do we feel that any of these should be backported into -stable kernels?
> [3/3] looks to be a candidate for this?

1 and 3 are fixes and should be sent to stable.

2 doesn't fix anything so I'm not sure how we could get it to be taken.
Peng Zhang April 5, 2023, 9:53 a.m. UTC | #4
在 2023/4/5 04:27, Andrew Morton 写道:

> On Tue, 14 Mar 2023 20:42:00 +0800 Peng Zhang <zhangpeng.00@bytedance.com> wrote:
>
>> Some fixes and clean up for maple tree.
>>
>> The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some
>> coincidences, because now the implementation of mtree_lookup_walk() scans
>> pivots one by one and exits the loop early. The test cases for the bugs fixed by
>> [PATCH v2 3/3] are difficult to write. If I think of how to write them later,
>> I will send them out. So I send out the second edition first.
> Do we feel that any of these should be backported into -stable kernels?
> [3/3] looks to be a candidate for this?

Both [1/3] and [3/3] can be sent to the stable kernel, do I need to do anything?
Liam R. Howlett April 5, 2023, 5:49 p.m. UTC | #5
* Peng Zhang <zhangpeng.00@bytedance.com> [230405 05:53]:
> 
> 在 2023/4/5 04:27, Andrew Morton 写道:
> 
> > On Tue, 14 Mar 2023 20:42:00 +0800 Peng Zhang <zhangpeng.00@bytedance.com> wrote:
> > 
> > > Some fixes and clean up for maple tree.
> > > 
> > > The bug fixed by [PATCH v2 1/3] does not seem to be triggered due to some
> > > coincidences, because now the implementation of mtree_lookup_walk() scans
> > > pivots one by one and exits the loop early. The test cases for the bugs fixed by
> > > [PATCH v2 3/3] are difficult to write. If I think of how to write them later,
> > > I will send them out. So I send out the second edition first.
> > Do we feel that any of these should be backported into -stable kernels?
> > [3/3] looks to be a candidate for this?
> 
> Both [1/3] and [3/3] can be sent to the stable kernel, do I need to do anything?
> 

Usually any bug fixes should have a commit message with:

Link: <any discussion>
Reported-by: <if necessary>
Fixes: <upstream commit>
Cc: <stable@vger.kernel.org>
and the usual S-O-B, reviewed-by