fix(savedata): report a save's size as the mount that created it gave #5094

Merged
bubblegg merged 1 commit from upstream-pr/5094 into main 2026-10-14 02:47:32 +00:00
bubblegg commented 2026-10-13 11:21:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by bubblegg on 2026-10-13T11:21:53Z.


What

sceSaveDataDirNameSearch infos and sceSaveDataGetMountInfo reported every save as SAVE_DATA_BLOCKS_MAX blocks, all of them free. A save's size is now the blocks of the sceSaveDataMount3 call that created it, kept beside the save in <dir>.blocks; a save without a kept size takes that of its next mount that names one, and otherwise keeps SAVE_DATA_BLOCKS_MAX. Free blocks are what the save's files leave of it, each file rounded up to 32 KiB blocks. Sort keys 2 (blocks) and 5 (free blocks) now sort by these values. sceSaveDataDelete removes the kept size. The technical debt entry is updated.

PPSA09030 creates its saves with 96 blocks. While the search reported 32768, it discarded them and showed its first-start EULA on every start.

Tested

Windows 11, WinLibs GCC 16.1.0. guest_savedata_search fails on main (an empty save must report all its blocks free) and passes with this change; the 15 save data tests pass. PPSA09030: the EULA no longer comes back and the trace shows the search followed by the mounts of both saves (the two saves made before this change were given their 96-block size by hand).

Checklist

  • Based on current main; no other open PR implements the same functions (#4876 and #3950 change other lines of sceSaveDataMount3)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA09030 #4680
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4842439055 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5094). Originally posted by [bubblegg](https://github.com/bubblegg) on 2026-10-13T11:21:53Z. --- ### What `sceSaveDataDirNameSearch` infos and `sceSaveDataGetMountInfo` reported every save as `SAVE_DATA_BLOCKS_MAX` blocks, all of them free. A save's size is now the `blocks` of the `sceSaveDataMount3` call that created it, kept beside the save in `<dir>.blocks`; a save without a kept size takes that of its next mount that names one, and otherwise keeps `SAVE_DATA_BLOCKS_MAX`. Free blocks are what the save's files leave of it, each file rounded up to 32 KiB blocks. Sort keys 2 (blocks) and 5 (free blocks) now sort by these values. `sceSaveDataDelete` removes the kept size. The technical debt entry is updated. PPSA09030 creates its saves with 96 blocks. While the search reported 32768, it discarded them and showed its first-start EULA on every start. ### Tested Windows 11, WinLibs GCC 16.1.0. `guest_savedata_search` fails on `main` (`an empty save must report all its blocks free`) and passes with this change; the 15 save data tests pass. PPSA09030: the EULA no longer comes back and the trace shows the search followed by the mounts of both saves (the two saves made before this change were given their 96-block size by hand). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#4876 and #3950 change other lines of `sceSaveDataMount3`) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA09030 #4680 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-13 14:08:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T14:08:13Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5173 core/libs/prx/libSceSaveData.native/Export.cpp L257, L327, L364-365
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6147439665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5094#issuecomment-6147439665). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T14:08:13Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5173 | `core/libs/prx/libSceSaveData.native/Export.cpp` [L257](https://github.com/boykopovar/AnyPS5/blob/aa1927872f8cd2fe604e0b87bac73b6d48d2cdc4/core/libs/prx/libSceSaveData.native/Export.cpp#L257), [L327](https://github.com/boykopovar/AnyPS5/blob/aa1927872f8cd2fe604e0b87bac73b6d48d2cdc4/core/libs/prx/libSceSaveData.native/Export.cpp#L327), [L364-365](https://github.com/boykopovar/AnyPS5/blob/aa1927872f8cd2fe604e0b87bac73b6d48d2cdc4/core/libs/prx/libSceSaveData.native/Export.cpp#L364-L365) | | |
coltken95 commented 2026-10-13 18:51:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T18:51:55Z.


Tested on Linux x86-64 (Release build), with 4b7a357bd merged into main 9d0a41d5a:

  • With the PR: guest_savedata_search passes.
  • With main's sources and the PR's test: guest_savedata_search fails.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152805823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5094#issuecomment-6152805823). Originally posted by [coltken95](https://github.com/coltken95) on 2026-10-13T18:51:55Z. --- Tested on Linux x86-64 (Release build), with 4b7a357bd merged into main 9d0a41d5a: - With the PR: `guest_savedata_search` passes. - With main's sources and the PR's test: `guest_savedata_search` fails. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5094
No description provided.