jingfei195887 opened a new pull request, #22494: URL: https://github.com/apache/nuttx/pull/22494
## Summary Check the file-position restoration result when creating a copied RAM mapping. If restoration fails, return the underlying error and release the temporary region before retaining the file or registering the mapping. The earlier msync position-restoration fix is already present upstream; this PR covers mapping creation only. ## Impact - Functionality: a RAM mapping is created only after the original file position has been restored successfully. - Compatibility: existing read/seek errors are preserved. Public interfaces, configuration, hardware, and build integration are unchanged. - Size: identical small sim configurations have text/data/bss deltas of 0/0/0 bytes. The regression application is disabled; a minimal mapping consumer keeps rammap linked in both images. ## Testing I confirm that changes are verified on local setup and work as intended: - Build host: Linux x86_64, GCC 13.1.0. Runtime target: sim:nsh with CONFIG_FS_RAMMAP and assertions. Baseline and branch use nuttx-apps c621be657e. - Local bounded driver checks cover public mmap and internal file_mmap, normal/short/interrupted/EOF reads, existing seek/read errors, position restoration errors, mapping accounting, and driver close/cleanup. The additional CONFIG_FS_LARGEFILE and 512 KiB FS heap configuration checks successful restoration above the 32-bit position range. Testing logs before change (0c45a2fc48b9): ```text RAMMAPRESTORE RESULT checks=652 failures=4 ``` Testing logs after change (d986021c338f): ```text default: RAMMAPRESTORE RESULT checks=650 failures=0 large-file/FS-heap: RAMMAPRESTORE RESULT checks=650 failures=0 ``` The check count drops by two because rejected mappings no longer need the test's cleanup of unexpectedly registered mappings. Full-file and commit checkpatch, Make/CMake, OSTest, and tested-HEAD gate pass. CONFIG_FS_RAMMAP-enabled qemu-armv7r:pnsh protected and qemu-armv8a:knsh kernel builds pass. No hardware runtime, protected/kernel runtime, SMP stress, or allocator-failure injection was performed. ## PR verification Self-Check - [x] This PR introduces only one functional change. - [x] I have updated all required description fields above. - [x] The commit has a component prefix, explanatory body, and my Signed-off-by; code style checks pass. - [ ] My PR is still work in progress (not ready for review). - [x] My PR is ready for review. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
