Skip to content

fix: update VFSNode path cache after rename in host_fs FUSE mount#80

Merged
jingkaihe merged 4 commits intojingkaihe:mainfrom
RealScout:fix/host-fs-rename-inode-cache
Mar 2, 2026
Merged

fix: update VFSNode path cache after rename in host_fs FUSE mount#80
jingkaihe merged 4 commits intojingkaihe:mainfrom
RealScout:fix/host-fs-rename-inode-cache

Conversation

@sosso
Copy link
Copy Markdown
Contributor

@sosso sosso commented Mar 1, 2026

Issue: #81

After a successful rename() through the host_fs FUSE mount, the guest
FUSE client (guest-fused) was not updating the cached VFSNode.path field
or go-fuse's internal inode tree. This caused subsequent open() calls on
the renamed file to send the old (deleted) path to the host VFS server,
resulting in ENOENT — even though readdir and stat returned correct data.

This broke git operations, since git uses atomic writes (write to .lock
temp file, then rename over target) for nearly every mutating operation
including checkout, commit, and add.

The fix adds two operations after a successful rename RPC in both
VFSRoot.Rename and VFSNode.Rename:
1. Update the child VFSNode.path to the new path
2. Call MvChild to update go-fuse's internal inode tree

Includes a minimal reproduction example in examples/host-fs-rename-repro.

This PR was generated with the assistance of Claude Code (claude-opus-4-6).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sosso
Copy link
Copy Markdown
Contributor Author

sosso commented Mar 1, 2026

LMK if you want anything else on this, @jingkaihe! This filesystem stuff is over my head 😅

@jingkaihe
Copy link
Copy Markdown
Owner

@sosso please can you create an issue for this? e.g. how to reprod? what is expected and what is the actual behaviour

@sosso
Copy link
Copy Markdown
Contributor Author

sosso commented Mar 2, 2026

@sosso please can you create an issue for this? e.g. how to reprod? what is expected and what is the actual behaviour

Done! #81. Wasn't sure if you wanted an issue first before a PR (since Discussions are deactivated on this repo), but I managed to get this working on my local, so I submitted this one. LMK if it makes sense 👍

@sosso
Copy link
Copy Markdown
Contributor Author

sosso commented Mar 2, 2026

Ah, I see your tests now. I did ask Opus about tests and it said things were going to be too heavy. Those look great!

jingkaihe added a commit to RealScout/matchlock that referenced this pull request Mar 2, 2026
Signed-off-by: Jingkai He <jingkai@hey.com>
Signed-off-by: Jingkai He <jingkai@hey.com>
@jingkaihe jingkaihe force-pushed the fix/host-fs-rename-inode-cache branch from f642163 to 95352eb Compare March 2, 2026 21:17
@jingkaihe jingkaihe merged commit 53a4c3a into jingkaihe:main Mar 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants