public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: David Sterba <dsterba@suse.cz>
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 10:14:09 +1100	[thread overview]
Message-ID: <20250403101409.65af0c9f.ddiss@suse.de> (raw)
In-Reply-To: <20250402220225.GP32661@twin.jikos.cz>

On Thu, 3 Apr 2025 00:02:25 +0200, David Sterba wrote:

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

This will jump straight through to the -ENOMEM goto fail path... What am
I missing here?
With 91e5bfe317d8f8471fbaa3e70cf66cae1314a516 I see:
#define BTRFS_PATH_AUTO_FREE(path_name)                                 \              
        struct btrfs_path *path_name __free(btrfs_free_path) = NULL 

I would expect your change to instead be something like:

   BTRFS_PATH_AUTO_FREE(path);
   path = btrfs_alloc_path();

  reply	other threads:[~2025-04-02 23:14 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
2025-04-02 23:14       ` David Disseldorp [this message]
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=20250403101409.65af0c9f.ddiss@suse.de \
    --to=ddiss@suse.de \
    --cc=dsterba@suse.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