linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Assemble: fix redundant memory free
@ 2023-09-12  2:27 Kinga Tanska
  2023-09-12  9:49 ` Mariusz Tkaczyk
  0 siblings, 1 reply; 3+ messages in thread
From: Kinga Tanska @ 2023-09-12  2:27 UTC (permalink / raw)
  To: linux-raid; +Cc: jes, colyli

Commit e9fb93af0f76 ("Fix memory leak in file Assemble")
fixes few memory leaks in Assemble, but it introduces
problem with assembling RAID volume. It was caused by
clearing metadata too fast, not only on fail in
select_devices() function.
This commit removes redundant memory free.

Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
---
 Assemble.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Assemble.c b/Assemble.c
index 61e8cd17..5be58e40 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -428,8 +428,6 @@ static int select_devices(struct mddev_dev *devlist,
 
 			/* make sure we finished the loop */
 			tmpdev = NULL;
-			free(st);
-			st = NULL;
 			goto loop;
 		} else {
 			content = *contentp;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Assemble: fix redundant memory free
  2023-09-12  2:27 [PATCH] Assemble: fix redundant memory free Kinga Tanska
@ 2023-09-12  9:49 ` Mariusz Tkaczyk
  2023-10-26 21:21   ` Jes Sorensen
  0 siblings, 1 reply; 3+ messages in thread
From: Mariusz Tkaczyk @ 2023-09-12  9:49 UTC (permalink / raw)
  To: jes; +Cc: Kinga Tanska, linux-raid, colyli

On Tue, 12 Sep 2023 04:27:01 +0200
Kinga Tanska <kinga.tanska@intel.com> wrote:

> Commit e9fb93af0f76 ("Fix memory leak in file Assemble")
> fixes few memory leaks in Assemble, but it introduces
> problem with assembling RAID volume. It was caused by
> clearing metadata too fast, not only on fail in
> select_devices() function.
> This commit removes redundant memory free.
> 
> Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
> ---
>  Assemble.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/Assemble.c b/Assemble.c
> index 61e8cd17..5be58e40 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -428,8 +428,6 @@ static int select_devices(struct mddev_dev *devlist,
>  
>  			/* make sure we finished the loop */
>  			tmpdev = NULL;
> -			free(st);
> -			st = NULL;
>  			goto loop;
>  		} else {
>  			content = *contentp;

Hi Jes,
It is a regression. Please merge it ASAP, it broke a a lot of our tests.

Thanks,
Mariusz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Assemble: fix redundant memory free
  2023-09-12  9:49 ` Mariusz Tkaczyk
@ 2023-10-26 21:21   ` Jes Sorensen
  0 siblings, 0 replies; 3+ messages in thread
From: Jes Sorensen @ 2023-10-26 21:21 UTC (permalink / raw)
  To: Mariusz Tkaczyk; +Cc: Kinga Tanska, linux-raid, colyli

On 9/12/23 05:49, Mariusz Tkaczyk wrote:
> On Tue, 12 Sep 2023 04:27:01 +0200
> Kinga Tanska <kinga.tanska@intel.com> wrote:
> 
>> Commit e9fb93af0f76 ("Fix memory leak in file Assemble")
>> fixes few memory leaks in Assemble, but it introduces
>> problem with assembling RAID volume. It was caused by
>> clearing metadata too fast, not only on fail in
>> select_devices() function.
>> This commit removes redundant memory free.
>>
>> Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
>> ---
>>  Assemble.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/Assemble.c b/Assemble.c
>> index 61e8cd17..5be58e40 100644
>> --- a/Assemble.c
>> +++ b/Assemble.c
>> @@ -428,8 +428,6 @@ static int select_devices(struct mddev_dev *devlist,
>>  
>>  			/* make sure we finished the loop */
>>  			tmpdev = NULL;
>> -			free(st);
>> -			st = NULL;
>>  			goto loop;
>>  		} else {
>>  			content = *contentp;
> 
> Hi Jes,
> It is a regression. Please merge it ASAP, it broke a a lot of our tests.

Applied!

Sorry for missing this.

Thanks,
Jes



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-26 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12  2:27 [PATCH] Assemble: fix redundant memory free Kinga Tanska
2023-09-12  9:49 ` Mariusz Tkaczyk
2023-10-26 21:21   ` Jes Sorensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).