Re: [PATCH v2] md/raid1: Fix stack memory use after return in raid1_reshape

From: Wang Jinchao
Date: Wed Jun 18 2025 - 07:54:28 EST


On 6/16/25 19:32, Yu Kuai wrote:
Hi,

在 2025/06/16 18:11, Wang Jinchao 写道:
On 6/13/25 19:53, Wang Jinchao wrote:
On 2025/6/13 17:15, Yu Kuai wrote:
Hi,

在 2025/06/12 20:21, Wang Jinchao 写道:
BTW, I feel raid1_reshape can be better coding with following:

And another hint:

The poolinfo can be removed directly, the only other place to use it
is r1buf_pool, and can covert to pass in conf or &conf->raid_disks.
Thanks, I'll review these relationships carefully before refactoring.

Thanks,
Kuai

Hi,
I’ve changed r1bio_pool to a pointer type and sent the patch.
As for the other two optimization suggestions, I found it challenging
to implement proper error rollback after the changes.
I tried a few times but couldn't come up with code I’m happy with,
so I’ve decided to put it on hold for now.

Thanks for your guidance.
.