fix(libSceSaveData.native): accept bit 0 of the sceSaveDataUmount2 mode without the backup bit #24325
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24325"
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 boykopovar/AnyPS5. Originally posted by birdmarty on 2026-11-20T14:11:48Z.
What
#23789 made
sceSaveDataUmount2throw on any mode other than0,0x10000and0x10001. Two titles unmount with0x1, bit 0 without the backup bit, and now abort withsceSaveDataUmount2: unknown modewhenever they write a save:Before #23789 the mode was ignored, so this is a regression from that PR.
Bit 0 is now accepted with or without bit 16 and has no effect. Bit 16 (
0x10000) still backs up and sendsSAVE_DATA_EVENT_TYPE_UMOUNT_BACKUP, and a mode with any other bit still throws.Why bit 0 is ignored rather than given a meaning:
sceSaveDataUmount2(0x1, "/savedata0"). It reports0,0x1and0x10001across titles, and notes that Sonic Frontiers adds0x10000to another value under a runtime condition, so bit 16 is a separate flag.0x20(SAVE_DATA_MOUNT_MODE_CREATE2) and passes the result:0x1after aCREATE2mount,0after its read-only mounts. Lies of P also mounts withCREATE2but unmounts with0x10000, so bit 0 is a choice the title makes, not somethingCREATE2requires.0x1unmount. Both go on rendering, so no backup completion is expected from bit 0 alone.No source says what bit 0 does on a console; the debt entry says so. The name
SAVE_DATA_UMOUNT_MODE_BACKUP_FORCEcomes from #23789, not from an SDK source.Changes
libSceSaveData.native/Export.cpp:sceSaveDataUmount2throws only when the mode has a bit other than 0 and 16.GuestSaveDataMountStatus.cpp:1is no longer listed as an unknown mode. After aCREATE2mount and a write,umount2(1)returns 0, unmounts, posts no event, makes no backup and keeps the data.2,0x20000and0x10002still throw.docs/dev/debt/changes/fix-savedata-umount2-backup.md: the pendingsceSaveDataUmount2entry from #23789 now covers bit 0. That entry is still in a fragment, which achangefragment cannot target, so the fragment is edited directly. If it is folded first, I will rebase this onto achangefragment.Tested
Windows 11 Pro (build 26300), AMD Radeon RX 6800 (AMD driver 26.10.1), MinGW-w64 GCC 15.3.0, Release build with tests, rebased onto
main0a025bd3c6(branch commitfd214329eb).Tests:
ctest -R savedata: 39 of 39 passed (13.25 s).main'sExport.cppunder these tests,guest_savedata_mount_statusaborts withsceSaveDataUmount2: unknown modeat the newumount2(1)case.tools/check_conventions.py --base origin/mainandtools/debt_fold.py --check: passed.tools/pr_overlap.py --names sceSaveDataUmount2and--branch fix/savedata-umount2-mode-bit0: no open pull request implementssceSaveDataUmount2, and no overlap with open pull requests.Title runs (same code diff
460225403eonmain291739adca):Final Fantasy VII Rebirth (PPSA08668 01.080):
ff7rebirthcommon. A run that finds the save goes on, but aborts on the first save from the menu ("Saving game data...").sceSaveDataUmount2: unknown mode 0x1 (1).mount3 mode=0x20, then the write, thenumount2 mode=0x1 -> 0.umount2 mode=0x1 -> 0succeeds on menu saves and New Game saves; in a longer run (~1,087 s, with the min-LOD AGC fix) the title saved, cleared the intro cutscenes, and reached gameplay.Dead Cells (PPSA15552 01.005, #9659):
sceSaveDataUmount2: unknown modeat the menu.umount2 mode=0x1 -> 0, thenumount2 mode=0x10001 -> 0twice, around writes ofdc_options.json.Not tested: what bit 0 does on a console, Linux, other GPUs.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T14:29:49Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
fd214329eb:tools/check_conventions.pypassed.guest_savedata_mount_status_testsbuilt cleanly.guest_savedata_mount_status):core/libs/prx/libSceSaveData.native/Export.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T14:36:21Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation accepts bit 0 without triggering backup behavior, and the inspected tests cover the relevant accepted and rejected modes.
What I ran
Reviewed head
fd214329eb6cdc9029260a4c71a572ace3d7b163. Read the prepared diff and all three changed files; inspectedunmountMountPointand the test context. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description's build, test, convention, debt-fold, overlap, and title-run results were not independently verified. The remaining portions of
Export.cppandGuestSaveDataMountStatus.cpp, and all repository files outside the three changed files, were not read. Bit 0's effect on a physical console remains unknown, as documented by the author.To get this to a good state
Nothing is required.