fix(libkernel): share guest rename semantics with sceKernelRename #6484
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6484"
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 Ondra97 on 2026-10-15T17:06:27Z.
What
On Windows,
sceKernelRenamerejects replacement of an empty directory and collapses distinct filesystem failures to EIO. I route it through the existing guest rename helper and translate its guest errno to the kernel error result. The rebase preserves current main'sEFAULTresult for null source or destination paths, including all three null combinations covered byguest_posix_scalar_io.The shared Windows helper replaces an empty directory using the existing atomic
FileRenameInfoExoperation, opening directory handles withFILE_FLAG_BACKUP_SEMANTICS. It no longer deletes the destination before attempting the rename. A failed operation preserves both source and destination. The regression covers libc and kernel routes, moved contents and specific kernel errors.The eligibility test retains startup, input-read and completion markers and reports captured output on timeout. It preserves main's existing 90-second subprocess limit; the cause of the earlier unreproduced CI stall remains unknown.
All three existing commits and their authorship are preserved. The inherited #6452 fixture is already in main. The agreed order is #6484 before #6583; #6583 declares
Depends on: #6484and will adapt the failure diagnostics to its persistent harness.Tested
Exact head:
8e1f06b51134e52d64837c450b1a7eecf9deb98d. Base:66702f1cffd3646f2d674ed093fde0a85a70761f.Windows (native host): Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 32 GB RAM, NVIDIA GeForce RTX 4070 Ti SUPER. WinLibs MinGW-w64 GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2, Release, bundled dependencies,
BUILD_TESTING=ON, Python 3.14.7, Node 24.20.0. Graphics: not exercised.cmake --build build-team-worker-2-runtime --parallel 2.--parallel 2 --timeout 30. The symbolic-link subcases insideguest_kernel_sysreported unavailable and remain untested on Windows.Linux (VirtualBox): Ubuntu 24.04.5 LTS, kernel 7.0.0-38-generic, GCC 13.3.0, CMake 3.28.3, Ninja 1.11.1, Release, bundled dependencies,
BUILD_TESTING=ON, Python 3.12.3. VirtualBox 7.2.20 r175154 on the Windows host above, 4 vCPU, 8 GiB RAM, native ext4. Graphics: not exercised. Node 24.20.0 is an official portable runtime added only to the test subprocess PATH.cmake --build build --parallel 2.--parallel 1. The three directory-buffer/rewind/close tests are registered only on Windows.The Windows selection is
patched_libraries,guest_kernel_sys,file_position,guest_working_directory,guest_realpath,guest_path_case,guest_directory,file_streams,guest_posix_filesystem,guest_file_timestamps,guest_filesystem,guest_kernel_rename,guest_dup,guest_directory_buffer,guest_directory_rewind,guest_directory_close,guest_kernel_fcntl,build_eligibility,guest_pthread_cancel,guest_posix_scalar_io. Linux uses the same filter except the three Windows-only tests. The scalar-I/O test verifies the EFAULT behavior retained during this rebase.Conventions, whitespace and main-sync checks pass. Before execution, static review covered the complete five-file PR diff and all 159 files in the upstream delta
673f7406c5ceedffc48bd2054d02c48096bb258a..66702f1cffd3646f2d674ed093fde0a85a70761f, including build/test code and new files.Earlier before/after API control, retained from the preceding revision: Linux (VirtualBox), Ubuntu 24.04.5 LTS, kernel 7.0.0-31-generic. An independent probe loads the real unpatched
libkernel.prxand checks ownership ofsceKernelRenamewithdladdr. The before variant rebuilt the three rename-related implementation files frombf2053816976bb9c821e37df58ef64a7362b81c7; the after variant used fix6bf2ce4714bed96acfc31354cb255561d83b97aeon base673f7406c5ceedffc48bd2054d02c48096bb258a. One invocation per variant, four filesystem cases, the same environment and fixtures, with paths and marker contents checked. This historical probe was not repeated for the current rebase; the current CTests above cover the integrated behavior.0x80020005(EIO)0x80020002(ENOENT)0x80020005(EIO)0x80020015(EISDIR)0x80020005(EIO)0x80020042(ENOTEMPTY)00The earlier base probe matched 1/4 expected results; the fixed probe matched 4/4, with expected data preserved. The base regression process aborted without an assertion diagnostic; the table uses the separate ownership-checked API probe and does not assign that abort to a particular assertion.
Linux graphics/Vulkan tests: NOT RUN — intentionally excluded from VirtualBox validation. Native/bare-metal Linux was not tested. Native Linux GPU validation: not tested. No full CTest suite, console or retail-title run is claimed. Full hosted Windows/Linux builds require collaborator dispatch under CONTRIBUTING.md; the full builds above are local.
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 github-actions[bot] on 2026-10-15T17:29:18Z.
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.
main)core/libs/prx/libkernel/File/src/Stdio.cppL1326-1343Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libc/src/Rename.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/tests/GuestFilesystem.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/tests/GuestFilesystem.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libc/src/Rename.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libc/src/Rename.cppcore/libs/prx/libkernel/File/src/Stdio.cppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T18:09:29Z.
Review: COMMENTED
Linux run at the updated head, since the description says Linux was not rerun there.
Ubuntu 26.04, i7-8700, gcc 15.2, Release,
BUILD_TESTING=ON, full build. Head1719a0f1fapplied onmain03c4cb5e7(its merge base).GuestFilesystem.cpponmain's source):guest_filesystemfails, but not where it fails on Windows. On Linuxmainalready replaces the empty directory, becauserename(2)does, so that check passes. The first failure is line 533: renaming toabsent/targetreturns0x80020005instead of0x80020002, becausemain'ssceKernelRenameturns every native failure intoEIO. So on Linux the new block covers the errno translation, and the directory replacement part only fails on Windows.guest_filesystem,guest_kernel_renameand the other rename, directory, realpath, path-case andguest_kernel_systests (11) pass 5 times in a row.-E "^agc|gpu|vulkan|video_out",-j8): same result asmain. Onlyfile_writer_binaryandfile_writer_textfail, onmaintoo (this host's coreutils rejects the command they run). In one of the two suite runsguest_pthread_starttimed out under-j8load. It passed in the other run and 10 of 10 times on its own.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-15T23:53:14Z.
Windows run. Windows 11, WinLibs GCC 15.2.0 r7 (MinGW), Release,
BUILD_TESTING=ON, RTX 4080,ctest -j4 --timeout 300. Head 886d64707 merged intomain5d9dcc42d.guest_kernel_rename,guest_filesystem,guest_posix_filesystem,agc_driver_gpu_indirect_arguments_misaligned_writer_aheadandbuild_eligibilitypass.guest_kqueue("the vnode watch error lacks "parent""). An elevated session holds the backup privilege, which bypasses the denied-parent case; #6599, #6629 and #6173 address that test, and it is unrelated to this change.Not tested: a negative control on Windows.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T17:13:19Z.
Rebase handoff — rebased onto current
main(all four commits, authorship unchanged). One conflict, intools/tests/test_build_eligibility.py: your timeout-reporting wrapper now wrapsmain's raised 90 s timeout (the PR's 20 s was against the older harness timing).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
40b76774d.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T14:34:33Z.
Re-anchored rebase handoff —
mainmoved since the earlier handoff; rebased onto currentmainagain (all three commits apply cleanly now, authorship unchanged).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
a7e6bee73.