public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: David Disseldorp <ddiss@suse.de>
Cc: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/7] btrfs: do more trivial BTRFS_PATH_AUTO_FREE conversions
Date: Thu, 3 Apr 2025 00:02:25 +0200	[thread overview]
Message-ID: <20250402220225.GP32661@twin.jikos.cz> (raw)
In-Reply-To: <20250402113951.06f43687.ddiss@suse.de>

On Wed, Apr 02, 2025 at 11:39:51AM +1100, David Disseldorp wrote:
> Hi David
> 
> On Wed,  2 Apr 2025 01:18:06 +0200, David Sterba wrote:
> 
> > @@ -308,7 +308,7 @@ int btrfs_truncate_free_space_cache(struct btrfs_trans_handle *trans,
> >  	bool locked = false;
> >  
> >  	if (block_group) {
> > -		struct btrfs_path *path = btrfs_alloc_path();
> > +		BTRFS_PATH_AUTO_FREE(path);
> >  
> >  		if (!path) {
> >  			ret = -ENOMEM;
> 
> This one looks broken. btrfs_search_slot() needs it allocated.

Sorry, I don't see what you mean. There's no btrfs_search_slot() in
btrfs_truncate_free_space_cache(), perhaps you mean a different
function?

The macro BTRFS_PATH_AUTO_FREE still declares a pointer, only adds the
__cleanup parameter that calls btrfs_free_path() when the variable
leaves its scope. It's not declaring 'path' as plain variable, if I
interpret the comment 'needs it allocated' in that context.

  reply	other threads:[~2025-04-02 22:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01 23:18 [PATCH 0/7] More btrfs_path auto cleaning David Sterba
2025-04-01 23:18 ` [PATCH 1/7] btrfs: do more trivial BTRFS_PATH_AUTO_FREE conversions David Sterba
2025-04-02  0:39   ` David Disseldorp
2025-04-02 22:02     ` David Sterba [this message]
2025-04-02 23:14       ` David Disseldorp
2025-04-02 23:45         ` David Sterba
2025-04-01 23:18 ` [PATCH 2/7] btrfs: use BTRFS_PATH_AUTO_FREE in may_destroy_subvol() David Sterba
2025-04-01 23:18 ` [PATCH 3/7] btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_set_inode_index_count() David Sterba
2025-04-01 23:18 ` [PATCH 4/7] btrfs: use BTRFS_PATH_AUTO_FREE in can_nocow_extent() David Sterba
2025-04-01 23:18 ` [PATCH 5/7] btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_encoded_read_inline() David Sterba
2025-04-01 23:18 ` [PATCH 6/7] btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_del_inode_extref() David Sterba
2025-04-01 23:18 ` [PATCH 7/7] btrfs: use BTRFS_PATH_AUTO_FREE in btrfs_insert_inode_extref() David Sterba
2025-04-03  8:01 ` [PATCH 0/7] More btrfs_path auto cleaning Daniel Vacek
2025-04-05  4:13 ` Sun YangKai
2025-04-06 22:17   ` David Sterba
2025-04-07 22:10     ` Sun YangKai

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=20250402220225.GP32661@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=ddiss@suse.de \
    --cc=dsterba@suse.com \
    --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