btrfs: fix an on-stack path leak and migrate to auto-release for on-stack paths
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 3 repliesIn review
- v12 patches 3 repliesSuperseded
Changes in v2 from the cover letter
- 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.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs: fix a potential path leak in print_data_reloc_error()fs/ | +1 | 0 replies | |
| 2/2 | btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helperfs/ fs/ fs/ +1 more | +21 | 2 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | David Sterba |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] btrfs: fix an on-stack path leak and migrate to auto-release for on-stack paths
[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(-)
Signature · 1 line
2.52.0