Repository navigation
Conversation
|
Thanks for picking this up so quickly. I had prepared the same fix independently (danieljustus/kiri, branch
Independent results for the same approach ( |
|
@shuvroroy thanks for this PR. Before it can be reviewed and merged, every commit needs to be signed. GitHub shows c4d617a as unsigned. Please sign it (GPG or SSH, with the key added to your GitHub account as a signing key), then force-push. GitHub's guide: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
c4d617a to
a47c8da
Compare
|
What this changes and why
After a Mac deletes or replaces a bind-mounted file, the guest can retain a positive virtiofs dentry for about a second. Recreating the name in a container or reading an editor's atomic save then fails with
ENOENT.Expire cached file names on both
DandMevents, including without inotify watchers. For modifications, expire before looking up the target and raising notifications, so a watcher reads the replacement. Keep the cached dentry referenced through the fresh lookup to preserve watches on in-place edits. Directories and mount points remain cached.Add a regression to the Docker compatibility suite covering guest creation after host deletion, host rename-over-file, and host delete/recreate, with and without a watcher. The watcher reads the changed file from its event handler.
Fixes #399, including the replacement-file follow-up.
How you tested it
Tested on: macOS 27.2.1, Apple silicon. The x86_64 guest kernel was cross-compiled; Intel runtime testing was not performed.
Before and after on this Mac:
cargo xtask host,cargo xtask guest, andcargo xtask disk: passed.cargo xtask kernelandcargo xtask kernel --arch x86_64: passed with the final patch.DOCKER_CONTEXT=kiri-issue399 tests/bind-recreate.sh: all 30 attempts passed, including reads from the watcher's event handler.tests/e2e.sh: passed, including the existing inotify and symlink-repointing checks. The full Docker compatibility suite was not run.cargo test: 475 passed, 6 ignored.cargo clippy: passed with existing warnings.python3 scripts/ui-test.pywithCHROMEpointing to Chromium: 542 checks passed across 60 test files.bash -n tests/bind-recreate.sh tests/e2e.shandgit diff --check: passed.cargo fmt --checkreports existing repository-wide formatting differences. This change does not modify Rust source files.How you found it
AI tools used to write this change: Yes. Codex investigated and reproduced the issue and follow-up, implemented the kernel patch and regression test, and ran validation.
Checklist
cargo fmt,cargo clippyand the tests pass (existing formatting differences described above)