lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250414092251.GB16750@suse.cz>
Date: Mon, 14 Apr 2025 11:22:52 +0200
From: David Sterba <dsterba@...e.cz>
To: Daniel Vacek <neelx@...e.com>
Cc: Yangtao Li <frank.li@...o.com>, clm@...com, josef@...icpanda.com,
	dsterba@...e.com, linux-btrfs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: use BTRFS_PATH_AUTO_FREE in
 btrfs_truncate_inode_items()

On Fri, Apr 11, 2025 at 04:17:38PM +0200, Daniel Vacek wrote:
> On Fri, 11 Apr 2025 at 05:25, Yangtao Li <frank.li@...o.com> wrote:
> >
> > All cleanup paths lead to btrfs_path_free so we can define path with the
> > automatic free callback.
> >
> > And David Sterba point out that:
> >         We may still find cases worth converting, the typical pattern is
> >         btrfs_path_alloc() somewhere near top of the function and
> >         btrfs_free_path() called right before a return.
> >
> > So let's convert it.
> >
> > Signed-off-by: Yangtao Li <frank.li@...o.com>
> > ---
> >  fs/btrfs/inode-item.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> And what about the other functions in that file? We could even get rid
> of two allocations passing the path from ..._inode_ref() to
> ..._inode_extref().

If you mean to pass the path object from btrfs_del_inode_ref() to
btrfs_del_inode_extref() yeah this looks like a good optimization and
reducing the allocations (and potential failures).

The other cases in the "..._inode_ref" is btrfs_insert_inode_ref() ->
btrfs_insert_inode_extref().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ