flush a kept save blob that had to be copied #1666
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1667"
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?
Imported from Marvisak/VIctory. Originally posted by imjustprism on 2026-11-24T20:35:56Z.
when a save update keeps a blob, commit hard-links it from the previous version, and if the link fails it falls back to std::fs::copy. that copy was never flushed, but the new version is renamed in and the old one deleted right after, so a power cut could leave a committed version with an empty kept blob and no old version to go back to. the fallback now goes through the same write + sync_all as new data.
the fallback only runs where hard links fail: a data folder on a volume without them (fat32/exfat, some shares), or a blob that already has 1024 links. i checked on ntfs that another process holding the old blob open does not make the link fail, so that is not a trigger.
no test can see whether bytes reached the disk, so there is no test that fails without this. the new test forces the fallback through the ntfs link limit and checks the committed version has the kept blob's exact bytes, which nothing covered before. clippy both ways, cargo test --workspace (343 passed) and xtask policy on windows 11.
touches the same two lines as #237.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:41:50Z.
Review: COMMENTED
Static review only: Windows-only code (D3D12/windows_sys/Win32/HLE) — nothing compiles or runs on macOS; source review of the diff.
Kept save blobs that hit the NTFS 1024-hard-link limit are now copied with exact bytes instead of failing the commit: Source::Kept tries hard_link then falls back to read+write. The test is excellent — it creates 1023 links to fill the limit, asserts TooManyLinks on the 1025th, commits a new version keeping blob 'b', and verifies state. Windows-only (cfg(windows) test).
Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:09:37Z.
Tested on Windows 11 with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-hlemainmain+ this PRcargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.