All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] btrfs: fix an on-stack path leak and migrate to auto-release for on-stack paths
@ 2025-11-25 21:50 Qu Wenruo
  2025-11-25 21:50 ` [PATCH v2 1/2] btrfs: fix a potential path leak in print_data_reloc_error() Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Qu Wenruo @ 2025-11-25 21:50 UTC (permalink / raw)
  To: linux-btrfs

[CHANGELOG]
v2:
- Add back an early btrfs_release_path() call in
  print_data_reloc_error()
  This is to avoid holding the path (and its extent buffers locked)
  during time consuming iterate_extent_inodes() calls.

  And add a comment on that early release, with updated commit message.

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  |  9 +++++++++
 fs/btrfs/defrag.c |  5 +----
 fs/btrfs/inode.c  |  7 +++++--
 fs/btrfs/scrub.c  | 18 ++++++------------
 4 files changed, 21 insertions(+), 18 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2025-12-08 20:56 UTC | newest]

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.