fix: close leaked fd on concurrent handle reopen race and remap fh_out#550
Closed
claude-claude[bot] wants to merge 1 commit intofuse-pipe-restorefrom
Closed
fix: close leaked fd on concurrent handle reopen race and remap fh_out#550claude-claude[bot] wants to merge 1 commit intofuse-pipe-restorefrom
claude-claude[bot] wants to merge 1 commit intofuse-pipe-restorefrom
Conversation
- In try_reopen_handle, when two threads race to reopen the same stale handle, the losing thread's newly opened fd was leaked. Now the loser sends Release/Releasedir to the inner handler to close the orphaned fd. - Add fh_out(), ino_out(), with_fh_out() protocol helpers so CopyFileRange/RemapFileRange stale-handle recovery remaps both fh_in and fh_out (previously only fh_in was remapped). - Fix misleading log field: entries -> bytes (json.len() is byte count). - Fix copy-paste doc comment on test_open_handle_survives_snapshot_restore. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Owner
|
Fixing manually in the main PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-Fix for PR #549
Issues Fixed
[MEDIUM] File descriptor leak on concurrent handle reopen race — When two threads race to reopen the same stale handle in
try_reopen_handle, the losing thread's newly opened fd was never released. Now the loser sendsRelease/Releasedirto the inner handler to close the orphaned fd.[MEDIUM] Incomplete fh_out remapping for CopyFileRange/RemapFileRange — Added
fh_out(),ino_out(), andwith_fh_out()protocol helpers. The stale-handle recovery path now remaps bothfh_inandfh_out, matching the existingremap_request_inodeswhich already handles bothino_inandino_out.[LOW] Misleading log field name — Changed
entries = json.len()tobytes = json.len()sinceserialize_table()returns aStringand.len()is byte count, not entry count.[LOW] Copy-paste doc comment — Fixed test doc comment that incorrectly referenced
--non-blocking-outputinstead of describing the snapshot restore test.Changes
fuse-pipe/src/server/remap.rs: Release orphaned fd intry_reopen_handlerace loser path; remapfh_outin handle translation and EBADF retryfuse-pipe/src/protocol/request.rs: Addfh_out(),ino_out(),with_fh_out()helperssrc/commands/podman/snapshot.rs: Fix log field nametests/test_portable_volumes.rs: Fix doc commentGenerated by Claude | Review Run