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

Peng Zhang posted 3 patches 2 years, 11 months ago
lib/maple_tree.c | 52 ++++++++++--------------------------------------
1 file changed, 11 insertions(+), 41 deletions(-)
[PATCH v2 0/3] Some fixes and cleanup for maple tree.
Posted by Peng Zhang 2 years, 11 months ago
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(-)

-- 
2.20.1
Re: [PATCH v2 0/3] Some fixes and cleanup for maple tree.
Posted by Andrew Morton 2 years, 10 months ago
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?
Re: [PATCH v2 0/3] Some fixes and cleanup for maple tree.
Posted by Peng Zhang 2 years, 10 months ago
在 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?

Re: [PATCH v2 0/3] Some fixes and cleanup for maple tree.
Posted by Liam R. Howlett 2 years, 10 months ago
* 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
Re: [PATCH v2 0/3] Some fixes and cleanup for maple tree.
Posted by Liam R. Howlett 2 years, 10 months ago
* 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.
Re: [PATCH v2 0/3] Some fixes and cleanup for maple tree.
Posted by Peng Zhang 2 years, 10 months ago
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(-)
>