VFS: preserve the destination when an overlay rename fails #160
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!160
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/160/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ebarr24 on GitHub · 2026-11-23 18:00 UTC · original
ebarr24:fix/vfs-locked-overlay-move→main· +67 −13 · 2 files · 1 commits · merged 2026-11-23 20:51 UTCA 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.
@ivall on GitHub · 2026-11-23 20:52 UTC · original
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 main38b05b7:cargo build --workspace && cargo test --workspace -- --test-threads=4- 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.@mstr-vinegar on GitHub · 2026-11-23 18:36 UTC · original · reviewed
Reviewed
c00a305and 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(qualifyingGetLastErrorfor 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 andcargo test --locked -p xcl vfs -- --test-threads=4reported 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.