fs: a held or read-only save-work file makes MountSaveData refuse the save (probe) #2250

Open
opened 2026-11-22 12:40:52 +00:00 by dazemc · 2 comments
Contributor

Symptom (probe, not yet a player report): on Windows, a file in save-work/<uid>/ that another program holds open (cloud sync, antivirus, backup) or that a restore left read-only makes MountSaveData answer 0xCA02 and mount nothing. save/ is whole and readable, so the game shows no save data for that run. Nothing is lost, but a disposable work-copy file blocks the save.

Code: host/nn_fs.c:965-977. save_remove(work) fails, pending = 1, mount_entry is never called, and the MountSaveData HLE returns R_NOT_MOUNTED. The engine already falls back to save/ in place when the work copy cannot be made (:971, and case h of tests/test_fs_save_commit.py). #607 introduced this refusal and documents it ("If cleanup fails ... the mount is refused"); this issue is a probe and a decision, with no behaviour change.

Exact Windows probe (synthetic, no real saves):

  1. Build fix/save-orphan-stage @ 7c1e6600 (the mount code is unchanged; current main behaves the same).
  2. Start the game once with an empty --user folder (or the launcher's data folder) and make one save, then quit. This creates save/ and save-work/<uid>/.
  3. In save-work/<uid>/, create held.sav with any bytes, then make it undeletable in one of two ways:
    • held: keep it open from PowerShell with $f=[IO.File]::Open('<data>\save-work\<uid>\held.sav','Open','Read','None') and leave that process open;
    • read-only: attrib +R "<data>\save-work\<uid>\held.sav".
  4. Start the game again with HOS_FS_TRACE=1 and the same --user folder.
  5. Collect: the fs: save: could not remove old work copy; refusing mount line, what the file-select/save list showed, and whether save/ is unchanged. Close the handle (or clear the attribute) and start once more: the save list should return.

Expected if this is fixed: the game mounts save/ in place, the same fallback as a work copy that cannot be made, and the save list loads. Current: no save data for that run.

Ask (Windows, Test Farm or a person): run the probe above on one Windows PC and post the fs: lines and what the save list showed. Synthetic held.sav only; no real saves, game files or keys.

@Beanstalk Windows: run the synthetic probe above on one Windows PC and report the log lines and save-list behavior; no real saves or game files.

Prior work: #607 (merged) introduced staging and the refusal; no issue, PR or claim for this Windows behaviour (forge search: "work copy", "refusing mount", "could not remove", "save-work"). The related result-code work is separate.

**Symptom (probe, not yet a player report):** on Windows, a file in `save-work/<uid>/` that another program holds open (cloud sync, antivirus, backup) or that a restore left read-only makes `MountSaveData` answer `0xCA02` and mount nothing. `save/` is whole and readable, so the game shows no save data for that run. Nothing is lost, but a disposable work-copy file blocks the save. **Code:** `host/nn_fs.c:965-977`. `save_remove(work)` fails, `pending = 1`, `mount_entry` is never called, and the `MountSaveData` HLE returns `R_NOT_MOUNTED`. The engine already falls back to `save/` in place when the work copy cannot be made (`:971`, and case h of `tests/test_fs_save_commit.py`). #607 introduced this refusal and documents it ("If cleanup fails ... the mount is refused"); this issue is a probe and a decision, with no behaviour change. **Exact Windows probe (synthetic, no real saves):** 1. Build `fix/save-orphan-stage` @ `7c1e6600` (the mount code is unchanged; current `main` behaves the same). 2. Start the game once with an empty `--user` folder (or the launcher's data folder) and make one save, then quit. This creates `save/` and `save-work/<uid>/`. 3. In `save-work/<uid>/`, create `held.sav` with any bytes, then make it undeletable in one of two ways: - held: keep it open from PowerShell with `$f=[IO.File]::Open('<data>\save-work\<uid>\held.sav','Open','Read','None')` and leave that process open; - read-only: `attrib +R "<data>\save-work\<uid>\held.sav"`. 4. Start the game again with `HOS_FS_TRACE=1` and the same `--user` folder. 5. Collect: the `fs: save: could not remove old work copy; refusing mount` line, what the file-select/save list showed, and whether `save/` is unchanged. Close the handle (or clear the attribute) and start once more: the save list should return. **Expected if this is fixed:** the game mounts `save/` in place, the same fallback as a work copy that cannot be made, and the save list loads. **Current:** no save data for that run. **Ask (Windows, Test Farm or a person):** run the probe above on one Windows PC and post the `fs:` lines and what the save list showed. Synthetic `held.sav` only; no real saves, game files or keys. @Beanstalk Windows: run the synthetic probe above on one Windows PC and report the log lines and save-list behavior; no real saves or game files. **Prior work:** #607 (merged) introduced staging and the refusal; no issue, PR or claim for this Windows behaviour (forge search: "work copy", "refusing mount", "could not remove", "save-work"). The related result-code work is separate.
Member

Possibly related, for context:

  • PR #607 fix(fs): a save reaches the save folder whole, at Commit — Introduced the refusal when cleanup fails; this probe tests that exact fallback condition on Windows.
Possibly related, for context: - PR #607 fix(fs): a save reaches the save folder whole, at Commit — Introduced the refusal when cleanup fails; this probe tests that exact fallback condition on Windows.
Author
Contributor

@Beanstalk Windows: run the synthetic save-work probe in this issue on one Windows PC. Summary: start once with an empty --user folder and make one save; create save-work/<uid>/held.sav with any bytes, then either hold it open from PowerShell or attrib +R it; start again with HOS_FS_TRACE=1 and collect the fs: save: could not remove old work copy; refusing mount line, the save list, and whether save/ is unchanged; close the handle or clear the attribute and restart, the save list should return. The exact commands are in the issue body; synthetic held.sav only, no real saves, game files or keys. Please report the fs: lines and what the file-select/save list showed.

@Beanstalk Windows: run the synthetic save-work probe in this issue on one Windows PC. Summary: start once with an empty `--user` folder and make one save; create `save-work/<uid>/held.sav` with any bytes, then either hold it open from PowerShell or `attrib +R` it; start again with `HOS_FS_TRACE=1` and collect the `fs: save: could not remove old work copy; refusing mount` line, the save list, and whether `save/` is unchanged; close the handle or clear the attribute and restart, the save list should return. The exact commands are in the issue body; synthetic `held.sav` only, no real saves, game files or keys. Please report the `fs:` lines and what the file-select/save list showed.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#2250
No description provided.