Repository navigation
fix(daemon): name every change a dirty Unmount refusal counts - #488
Merged
yifanxuaaa merged 1 commit intoOct 28, 2026
Merged
Conversation
A checked Unmount without discard refused with "Dirty: 0 uncommitted change(s)" after changes a Commit drops (touch ., create+unlink, mkdir+rmdir), and after a real directory chmod it counted the change but named no path. The dirty probe now skips rows that are no change - a locally created inode no name binds any more, and a base directory whose mode equals the base (Commit ignores its mtime) - and names a base directory whose mode differs, "/" for the root. Files stay conservative. Refs Ephemeral-AI-Lab#462. Not covered here, still as on main: - a base file whose only change is its mtime (e.g. /.git/index) still refuses Unmount, now naming that path; Commit would drop it. - list_changes still skips directories with a local row (operator/workspace.rs), so a directory chmod is named by the refusal but not listed by list_changes; status counts are unchanged. Test added: layerfs-api/tests/unmount_dirty.rs (touch ., touch .git, create+unlink, mkdir+rmdir close; chmod /, chmod /.git, a created file and an index mtime refuse naming exactly their path, not truncated). No tests deleted. Production LOC: 102,165 -> 102,200 (delta +35) Scope and method: tools/production_loc.py --root; layerfs-daemon 6,035 -> 6,070; reference absent (retired R9c; last counted 65,417 at tree 498dd19). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RGB-loop
marked this pull request as ready for review
October 27, 2026 22:16
jiangkoumo
added a commit
to jiangkoumo/layerfs
that referenced
this pull request
Oct 28, 2026
…-AI-Lab#427) Brings main up to 582bc78 (Ephemeral-AI-Lab#488, Ephemeral-AI-Lab#481 forced unmount after a stalled Join, Ephemeral-AI-Lab#479, Ephemeral-AI-Lab#471, Ephemeral-AI-Lab#473, Ephemeral-AI-Lab#445 fs modes, Ephemeral-AI-Lab#475, Ephemeral-AI-Lab#478, Ephemeral-AI-Lab#476 Docker API negotiation, Ephemeral-AI-Lab#396, Ephemeral-AI-Lab#419, Ephemeral-AI-Lab#418, Ephemeral-AI-Lab#415, Ephemeral-AI-Lab#477, Ephemeral-AI-Lab#468). Two conflicts, both from Ephemeral-AI-Lab#481 (forced unmount of a normal unmount stalled at Join): - engine/crates/layerfs-daemon/src/control/force.rs: guard() keeps this branch's ExportKept check (an NFS export kept after a failed teardown answers with its stored custody first) and takes main's comment and its forceable() exception for a retained FUSE session. The non-Linux `let _ = token;` stays removed: ExportKept uses the token on every platform. - engine/crates/layerfs-node/src/workspace.rs: unmount() keeps this branch's per-Workspace unmount lease (repeat a published outcome, drop the admission guard before the daemon call, publish the outcome before cleanup) and takes main's `force` option inside it: forced, one api.unmount(token, true) whose None answer is Unmounted::Closed; otherwise unmount_checked with `discard` as before. Production LOC: first-parent 9478190 108596 -> 109158 (tools/production_loc.py --root .; the delta is main's own changes)
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.
Refs #462. This fixes the refusal half of the issue; two items in its Expected section are not covered (listed under "Not changed").
Problem
A checked
workspace.unmountwithoutdiscardcounts every dirty overlay inode. Aftertouch .,touch .probe && rm .probeormkdir .d && rmdir .d, the overlay holds inode rows a Commit drops, so the unmount is refusedDirty: 0 uncommitted change(s)withchanged: [], whileworkspace.commitanswersUpToDate. After a real directorychmod, the change is counted but no path is named, because the probe only names entry rows.Fix
control/dirty.rsonly. The dirty probe now follows Commit's rule for the rows it counts:/for the root.Files stay conservative: a changed base file is still counted and named, even when only its mtime changed.
Not changed
/.git/index) still refuses the unmount. It is now named, but Commit would drop it.list_changesstill skips directories that have a local row (operator/workspace.rs), so a directorychmodis named by the refusal but not listed bylist_changes. Status counts are unchanged.Tests
New
layerfs-api/tests/unmount_dirty.rs:changes_a_commit_drops_do_not_refuse_an_unmount:touch .,touch .git, create+unlink, mkdir+rmdir unmount without discard.a_refusal_names_every_change_it_counts:chmod /,chmod /.git, a created file and an index mtime change refuse, naming exactly their path, not truncated.On
mainwithout thedirty.rschange, both fail:With it, both pass. Locally (Linux, Rust 1.95.0, Disposable fixture, no mount):
cargo fmt --checkand the boundary check pass;cargo clippy -p layerfs-daemon --lib -p layerfs-api --test unmount_dirty -- -D warningspasses with-A clippy::result_large_err(on 1.95 that lint fires only in three files this PR does not touch); the otherlayerfs-daemon/layerfs-apitests that fail here need/dev/fuse, fusectl or cgroups, which this host does not have. Not run locally: the CI toolchain (1.85.1), FUSE end-to-end tests and macOS.Production LOC: +35 (
layerfs-daemon6,035 -> 6,070).🤖 Generated with Claude Code