sdk/rust: Fix stale base inodes after remount in overlayfs#318
Merged
penberg merged 1 commit intotursodatabase:mainfrom Feb 13, 2026
Merged
Conversation
d5187c6 to
72a3568
Compare
After remount, origin mappings (fs_origin table) recreate overlay inodes tagged Layer::Base with stale underlying_ino values from the previous HostFS session. The new HostFS has a fresh inode cache, so any operation using the stale inode (lookup, readdir, unlink, etc.) fails with NotFound. Fix by not creating a new Base-tagged overlay inode when the origin mapping's base_ino has no live entry in the reverse_map. This only happens after remount (the reverse_map is empty); within a session promote_to_delta already keeps it correct. Falling back to the Delta overlay inode is safe because all downstream code already walks base from root when the parent is tagged Delta. Add 4 tests covering base file lookup, whiteout creation, delta entry cleanup, and link copy-up across remount boundaries.
72a3568 to
0ac1e28
Compare
Collaborator
|
Thanks @broady! |
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.
After remount, origin mappings (fs_origin table) recreate overlay inodes
tagged Layer::Base with stale underlying_ino values from the previous
HostFS session. The new HostFS has a fresh inode cache, so any
operation using the stale inode (lookup, readdir, unlink, etc.) fails
with NotFound.
Fix by not creating a new Base-tagged overlay inode when the origin
mapping's base_ino has no live entry in the reverse_map. This only
happens after remount (the reverse_map is empty); within a session
promote_to_delta already keeps it correct. Falling back to the Delta
overlay inode is safe because all downstream code already walks base
from root when the parent is tagged Delta.
Add 4 tests covering base file lookup, whiteout creation, delta entry
cleanup, and link copy-up across remount boundaries.