public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Sun YangKai <sunk67188@gmail.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions
Date: Fri, 22 Aug 2025 23:51:18 +0800	[thread overview]
Message-ID: <13839041.dW097sEU6C@saltykitkat> (raw)
In-Reply-To: <20250822130123.GV22430@twin.jikos.cz>

> Please split the patch to parts that have the described trivial changes,
> and then one patch per function in case it's not trivial and needs some
> adjustments.
> 

After learning more about the auto-free/cleanup mechanism, I realized that its 
only advantage is to eliminate the need for the goto out; pattern. Therefore, 
it seems unnecessary to apply this conversion in non-trivial cases.

Moreover, if the cleanup code contains other logic, it might be better to 
leave it unchanged even in trivial cases.

> The freeing followed by other code can be still converted to auto
> cleaning but there must be an explicit path = NULL after the free.

I'm sorry, I didn't understand. If the freeing is followed by other code, 
maybe we could just leave them untouched?

Please let me know if I've got anything wrong.

Best regards,
Sun Yangkai




  parent reply	other threads:[~2025-08-22 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21 13:12 [PATCH v2 0/2] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions Sun YangKai
2025-08-21 13:12 ` [PATCH 1/2] btrfs: get_inode_info(): check NULL info parameter early Sun YangKai
2025-08-22 12:50   ` David Sterba
2025-08-22 12:58     ` Sun YangKai
2025-08-30  7:00   ` kernel test robot
2025-08-21 13:12 ` [PATCH 2/2] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions Sun YangKai
2025-08-22 13:01   ` David Sterba
2025-08-22 13:08     ` Sun YangKai
2025-08-22 15:51     ` Sun YangKai [this message]
2025-08-26 16:56       ` David Sterba
2025-08-27 12:24         ` Sun YangKai
2025-08-29  0:02           ` David Sterba

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=13839041.dW097sEU6C@saltykitkat \
    --to=sunk67188@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /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