public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: fix an on-stack path leak and migrate to auto-release for on-stack paths
@ 2025-11-25  8:19 Qu Wenruo
  2025-11-25  8:19 ` [PATCH 1/2] btrfs: fix a potential path leak in print_data_reloc_error() Qu Wenruo
  2025-11-25  8:19 ` [PATCH 2/2] btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper Qu Wenruo
  0 siblings, 2 replies; 6+ messages in thread
From: Qu Wenruo @ 2025-11-25  8:19 UTC (permalink / raw)
  To: linux-btrfs

I thought patch "btrfs: make sure extent and csum paths are always released in
scrub_raid56_parity_stripe()" has already taught us that tag based
manual cleanup is never reliable, now there is another similar bug in
print_data_reloc_error().

This time it is harder to expose, as we always imply if the function
returned an error, they should do the proper cleanup.
But extent_to_logical() does not follow that assumption.

The first patch is the minimal fix for backport, the second patch is
going to solve the problem by using auto-release for all on-stack btrfs
paths.

Qu Wenruo (2):
  btrfs: fix a potential path leak in print_data_reloc_error()
  btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper

 fs/btrfs/ctree.h  |  5 +++++
 fs/btrfs/defrag.c |  5 +----
 fs/btrfs/inode.c  |  5 +----
 fs/btrfs/scrub.c  | 18 ++++++------------
 4 files changed, 13 insertions(+), 20 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-25 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25  8:19 [PATCH 0/2] btrfs: fix an on-stack path leak and migrate to auto-release for on-stack paths Qu Wenruo
2025-11-25  8:19 ` [PATCH 1/2] btrfs: fix a potential path leak in print_data_reloc_error() Qu Wenruo
2025-11-25  8:19 ` [PATCH 2/2] btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper Qu Wenruo
2025-11-25 12:26   ` David Sterba
2025-11-25 14:51     ` David Sterba
2025-11-25 21:15       ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox