From 54843db406249022d9ec3dac52bf159d473120ac Mon Sep 17 00:00:00 2001 From: "claude[bot]" Date: Tue, 3 Mar 2026 23:52:10 +0000 Subject: [PATCH] fix: correct misleading comment about fh_out remapping and fix fmt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment on with_fh() for CopyFileRange/RemapFileRange incorrectly claimed "the EBADF retry in RemapFs handles one handle at a time via fh()" — but fh() only returns fh_in, and no code path ever remaps fh_out. Updated the comment to accurately document this as a known limitation with a TODO for future work. Also fixes a pre-existing cargo fmt issue in remap.rs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- fuse-pipe/src/protocol/request.rs | 7 ++++--- fuse-pipe/src/server/remap.rs | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fuse-pipe/src/protocol/request.rs b/fuse-pipe/src/protocol/request.rs index 366833df..f5f686cd 100644 --- a/fuse-pipe/src/protocol/request.rs +++ b/fuse-pipe/src/protocol/request.rs @@ -457,9 +457,10 @@ impl VolumeRequest { | Self::Setlk { fh, .. } | Self::Readdirplus { fh, .. } => *fh = new_fh, Self::Setattr { fh, .. } => *fh = Some(new_fh), - // Only remap fh_in; fh_out references a different file and must be - // remapped separately if it's also stale (the EBADF retry in RemapFs - // handles one handle at a time via fh()). + // Only remap fh_in; fh_out references a different file and is NOT + // currently remapped after snapshot restore. This is a known limitation: + // copy_file_range/remap_file_range with a stale fh_out will fail. + // TODO: add fh_out()/with_fh_out() helpers for independent remapping. Self::CopyFileRange { fh_in, .. } | Self::RemapFileRange { fh_in, .. } => { *fh_in = new_fh; } diff --git a/fuse-pipe/src/server/remap.rs b/fuse-pipe/src/server/remap.rs index 57394644..d065d750 100644 --- a/fuse-pipe/src/server/remap.rs +++ b/fuse-pipe/src/server/remap.rs @@ -539,7 +539,10 @@ impl RemapFs { let table: std::collections::BTreeMap = match serde_json::from_str(json) { Ok(t) => t, Err(e) => { - error!("failed to parse inode table JSON, starting with empty table: {}", e); + error!( + "failed to parse inode table JSON, starting with empty table: {}", + e + ); std::collections::BTreeMap::new() } };