fix(libkernel_sys): retain files across asynchronous I/O requests #12868
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12868"
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 PrivacyOnion on 2026-10-29T13:17:19Z.
What
aio_returnoraio_waitcomplete), following FreeBSD 11.4vfs_aio.c(referencing an underlying file object rather than a guest-visible descriptor slot).RetainedFile.cpp), keeping retained I/O isolated from guest-visible descriptor mutations.open,close,dup,dup2,fcntl(F_DUPFD, F_SETFL),ioctl,pipe) via a unified ownership lock (LockDescriptorOwnership_nid_no_patch), preventing race conditions where guest mutations could interleave with retention or publication.statusFlagsacross open file descriptors and retained references are stored asstd::shared_ptr<std::atomic<int>>, ensuring liveO_APPENDandO_FSYNC(O_SYNC) updates viafcntl(F_SETFL)are immediately and safely visible to concurrent asynchronous writes.guest_kernel_sys_aiocovering retained request lifetime across guest close/dup2, private slot reuse and isolation, descriptor cancellation, boundary allocation and evacuation race controls using deterministic stage hooks, and concurrentF_SETFLwith live append/sync write controls.Tested
Windows 11, Ryzen 5 5600, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON.
Commit 6872caa9db
$ ctest --test-dir build -R '^guest_kernel_sys_aio$' --output-on-failure
Test project C:/Users/playl/Desktop/dashy/data/worktrees/1029-202555-d29b/build
Start 470: guest_kernel_sys_aio
1/1 Test #470: guest_kernel_sys_aio ............. Passed 0.17 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.53 sec
Ran locally on
6872caa9db: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)Pull request closed