[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21a34072-7f09-4d4f-b490-43637996c91f@gmx.com>
Date: Thu, 6 Nov 2025 17:32:10 +1030
From: Qu Wenruo <quwenruo.btrfs@....com>
To: Markus Elfring <Markus.Elfring@....de>, Zilin Guan <zilin@....edu.cn>,
linux-btrfs@...r.kernel.org, Chris Mason <clm@...com>
Cc: LKML <linux-kernel@...r.kernel.org>, David Sterba <dsterba@...e.com>,
Jianhao Xu <jianhao.xu@....edu.cn>
Subject: Re: btrfs: scrub: fix memory leak in scrub_raid56_parity_stripe()
在 2025/11/6 17:25, Markus Elfring 写道:
>>> …
>>>> Add the missing bio_put() calls to properly drop the bio reference
>>>> in those error cases.
>>>
>>> How do you think about to use additional labels?
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.18-rc4#n526
>>
>> I believe the current hot fix is fine.
> …
>
> Would you like to care a bit more for avoidance of duplicate source code
> (also according to better exception handling)?
That is handled in this patch, a dedicated cleanup/refactor:
https://lore.kernel.org/linux-btrfs/2d2cfb7729a65d88ea8b9d6408611d0cc76e1ab7.1762398098.git.wqu@suse.com/T/#u
To be honest, doing that extra tag inside the original
scrub_raid56_parity_stripe() is not that helpful, that function is doing
a lot of different works, and @bio is only allocated for the last two
stages (using cached stripes and to wait for the scrub of parity stripe).
Doing a dedicated tag for less than half of the code is not going to
improve readability.
It's better to extract the unrelated behavior into a dedicated helper so
that it's way straight forward.
Thanks,
Qu
>
> Regards,
> Markus
>
Powered by blists - more mailing lists