flush a kept save blob that had to be copied #1667
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1667
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1667/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?
@imjustprism on GitHub · 2026-11-24 20:35 UTC · original
imjustprism:fix/save-kept-blob-sync→main· +34 −2 · 1 files · 1 commits · merged 2026-11-25 00:15 UTCwhen 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.
@acetonahard-code on GitHub · 2026-11-24 22:09 UTC · original
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.