Repository navigation
fix(savedata): leave the mount result untouched when sceSaveDataMount3 fails - #4876
Merged
oneandonlydean merged 2 commits intoOct 14, 2026
Conversation
…3 fails Animal Well (PPSA22520) checks for its save with a CREATE2 mount it never unmounts, then saves with a second mount of the same directory. That mount returns BUSY, and the title keeps using the first mount point for sceSaveDataPrepare, its save file and sceSaveDataUmount2. sceSaveDataMount3 cleared the result before its checks, so the save was written to "/save" in the game folder instead of the save directory, and the first mount was never released. The result is now written only when the mount succeeds, as shadPS4 does.
10 tasks done
Contributor
|
Windows test: head AI-assisted (Claude Code). |
5 tasks done
boykopovar#5173 changes the create condition right after the last error check, and boykopovar#3950 removes the comment after the create block, so clearing the result in either place made the pull requests conflict. The result is still cleared only after every error return and before anything is written to it.
Merged
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Animal Well (PPSA22520, content 01.000.011) saves its progress outside its save directory, and a save placed in the save directory is never loaded.
sceSaveDataMount3cleared the caller's result before its checks, and the title depends on the result surviving a failed mount:SAVEDATA(CREATE2),stats<mount point>/saveand never unmounts.SAVEDATAagain into the same global result. They ignore every error except NO_SPACE (0x809F000A) and use the result's mount point forsceSaveDataPrepare,open("<mount point>/save", O_RDWR | O_CREAT ...)and the finalsceSaveDataUmount2.main, that second mount returns BUSY with the mount point cleared. The title then opens/save(the game folder) and callssceSaveDataUmount2with an empty mount point (NOT_MOUNTED), so the first mount is never released:The result is now cleared and written only when the mount succeeds, as shadPS4's
saveDataMountdoes (it returns BUSY for an already mounted directory before writingmount_result). Every error return (BUSY, EXISTS, NOT_FOUND, MOUNT_FULL) leaves it as it was. The title ships with this save flow and saves on the console, so the console'ssceSaveDataMount3evidently leaves the mount point in place on BUSY as well. A technical debt entry records that this follows shadPS4 and the title, not a hardware run.Tested
main43e3a70:guest_savedata_mount_status. The new check mounts a save, mounts it again into the same result (BUSY, result unchanged), opens a missing save into it (NOT_FOUND, result unchanged), then unmounts through the kept mount point.main'sExport.cppthe three new checks fail.main43e3a70): withmain'sExport.cppthe same three checks fail; with the change, 20/20 pass.main43e3a70 with fix(libkernel): accept flag 0x8000 in sceKernelMapFlexibleMemory #4859 (the title needs it to boot), fix(libc): report host C++ exceptions that Windows cannot deliver #4693 and fix(agc-driver): delay storage writeback until queue activity settles #4410, with the save in_sd/SAVEDATA/save:savein the game folder and shows the new-game slot select._sd/SAVEDATA/save(mount3 ... -> 0x00000000 point=/savedata0,umount2 point=/savedata0 -> 0x00000000). Nothing is written to the game folder.main495bf91, which now has fix(libkernel): accept flag 0x8000 in sceKernelMapFlexibleMemory #4859, with nothing else applied: without this change the trace showsmount3 ... mode=0x20 -> 0x809f0003 point=andumount2 mode=0x0 point= -> 0x809f0004, the title opens/save(creating an emptysavein the game folder) and the slot select shows; with it, the title opens/savedata0/save, Continue loads the save, saving rewrites_sd/SAVEDATA/save, and every successful mount is unmounted.python3 tools/check_conventions.py --base origin/main: passed.mount3(at its end):Export.cppmerges cleanly with it.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)