mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Markus Elfring <Markus.Elfring@web.de>,
	Zilin Guan <zilin@seu.edu.cn>,
	linux-btrfs@vger.kernel.org, Chris Mason <clm@fb.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	David Sterba <dsterba@suse.com>,
	Jianhao Xu <jianhao.xu@seu.edu.cn>
Subject: Re: btrfs: scrub: fix memory leak in scrub_raid56_parity_stripe()
Date: Thu, 6 Nov 2025 17:32:10 +1030	[thread overview]
Message-ID: <21a34072-7f09-4d4f-b490-43637996c91f@gmx.com> (raw)
In-Reply-To: <c31de8ba-77d2-4d79-890a-c23f1797a735@web.de>



在 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
> 


  reply	other threads:[~2025-11-06  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  3:53 [PATCH] " Zilin Guan
2025-11-05  8:53 ` Qu Wenruo
2025-11-05 10:26 ` Markus Elfring
2025-11-06  2:12   ` Qu Wenruo
2025-11-06  6:55     ` Markus Elfring
2025-11-06  7:02       ` Qu Wenruo [this message]
2025-11-06  7:19         ` Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21a34072-7f09-4d4f-b490-43637996c91f@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=Markus.Elfring@web.de \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zilin@seu.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®