Repository navigation
VFS: honor read-only attributes in DeleteFileW - #2809
CryingLaughing wants to merge 1 commit into
Conversation
|
Regression run of Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main main: this PR: 99 % of main's frames, 103 % of its peak commit. One run each. Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report. |
…t, readonly-aware delete) Port upstream xcl-dev#2708 (live head 15393dc): the MAXIMUM_ALLOWED bit itself landed earlier via xcl-dev#2694 (91e37a8); this takes the remaining regression test a_maximum_allowed_open_takes_the_write_path verbatim into vfs.rs, pinning the write-path overlay copy plus the read-only-bit read path. Port upstream xcl-dev#2809 (live head 80cf435): whiteout_original_file(rel, check_readonly) verbatim into shared vfs.rs (Linux containment via checked_original_path), with delete_file delegating the hide-original half with check_readonly=false (move-retire keeps its policy, as upstream). The Windows-native hook half (MAX_PATH/extended-prefix juggling, native DeleteFileW sharing checks) stays out; the Linux twin vfs_hooks_linux::delete_file carries the readonly-check shape (symlink_metadata dir/readonly gates, overlay remove + commit, else whiteout_original_file(rel, true)), and kernelx_linux DeleteFileA/W route Game deletes through it. Close-time/best-effort removals and move_impl retire keep Vfs::delete_file directly (no readonly gate). Tests: vfs::tests +1, vfs_hooks_linux::tests +1 (Linux twin of the cfg(windows) vfs_readonly_delete: readonly original/overlay denied and still visible, writable paths unchanged, retire-after-move unaffected). Failing-first: readonly delete returned Ok before (scratch test), both upstream artifacts absent (grep 0). Gates: both checks 0 errors; lib 766/0/1 threads=4 (+2); title e2e 12 unique FAILs all D3D12.X 0 non-GPU; retail fresh root SIGSEGV exe+0x2237320 fault 0x0 unmapped stubs 20 xgr exactly 3 HOLDS.
DeleteFileWon a virtual game path could report success for a read-only file. Reject deletion of a read-only original withERROR_ACCESS_DENIEDand use native deletion semantics for an overlay copy. A rejected deletion leaves the file visible and preserves its contents. Related delete-by-handle PR #1054What is in it
crates/xcl/src/vfs.rs, check the original’s read-only attribute before recording a deletion marker. Preserve the move behavior for a read-only original.crates/xcl/src/vfs_hooks.rs, use nativeDeleteFileWfor overlay deletion, with an extended path when needed. Thecrates/xcl/tests/vfs_readonly_delete.rsintegration test exercises the installed hooks in a child process with synthetic files.Tested
80cf435643189a0ea2ec31f4e4e5642539b47815onb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Its tree8a2dc2fcc438ce0c4a94554b5d5ae5d80fd4b8a5matches the tested overlay. Windows 11 25H2 build 26200.9974, Intel Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, and DXC 1.8.2502.11. Debug build and test profiles.delete_file_respects_readonly_attributetest invfs_readonly_deletefailed on the parent (0 passed, 1 failed) because virtualDeleteFileWreported success forreadonly-original.txt. The fixed tree passed 1/1. Bothreadonly-original.txtandreadonly-overlay.txtreturnedERROR_ACCESS_DENIEDand kept their contents. Writable deletion, a path longer thanMAX_PATH, a read-only move, native-path behavior, and deletion markers checked after reopening also passed.cargo build --workspace --locked -j 4passed.cargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputreported 1,436 passed, 0 failed, 47 ignored, with 29 explicit skip messages in the pass count across 38 harnesses.Regression run
Independent retail smoke by Anon64 compared release builds of main and this exact head on an RTX 3060 12 GB (driver 581.80), Core i9-14900KF, and Windows 11 build 26200. The 60-second runs used the same title. The head retained 99.5% of the baseline frames and used 103.1% of its peak commit, with zero crashes or device removals. The run did not establish whether the title reached the changed code.
main:
PR:
Not tested