Repository navigation
VFS: preserve the destination when an overlay rename fails - #160
Conversation
Use the native same-volume rename for files already in the overlay. If Windows refuses to delete-share the source, the destination keeps its contents. Record the source whiteout once the move succeeds.
mstr-vinegar
left a comment
There was a problem hiding this comment.
Reviewed c00a305 and the surrounding VFS move, staging, and whiteout code. No blocking findings in the same-volume overlay-to-overlay path.
I copied the new regression test into base db5dc26 (qualifying GetLastError for the base imports): it failed because the destination had been overwritten with the source bytes after the move failed. On the PR head, the regression passed and cargo test --locked -p xcl vfs -- --test-threads=4 reported 16 passed, 0 failed on Windows 11, Rust 1.100.0 MSVC.
The test covers a single-volume overlay-to-overlay move; I did not validate cross-volume or external-destination behavior. AI-assisted review and testing.
|
Merged (main 2abc562), together with #171 - they are not duplicates: this one covers a destination inside the game folder, #171 one outside it (T:, temp). Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: |
A title that replaces an overlay file can lose the destination's contents even when its move returns failure. For an open source file without delete sharing, XCL's copy succeeds and overwrites the destination. Deleting the source then fails.
Use the native same-volume rename when the source already lives in the overlay and the destination is another game path. Windows checks delete sharing before replacing the destination. After a successful rename, XCL records the destination write and hides the game file that was under the source. Win32 MoveFileExW contract
Verification
Windows 11 25H2 (26200.9711), Rust 1.100.0
x86_64-pc-windows-gnu, RTX 3080 (driver 616.92), DXC 1.9.2609.5.db5dc26because the destination contains the source bytes after the move returns an error.c00a305the locked move reportsERROR_SHARING_VIOLATIONand preserves both files. Retrying after the source handle closes succeeds. The regression also checks the physical game files and the source whiteout.cargo test --locked -p xcl vfs -- --test-threads=4passes all 16 matching tests. The test uses a single NTFS volume.c33521cwith the two independent fixes reported 570 passes, zero failures and 39 ignored. Two native-wave64 tests and the unconfigured retail-sample tests returned early. Fixture test fix #157 · CreateFile status fix #158AI-assisted patch preparation and verification.