jingfei195887 opened a new pull request, #22500: URL: https://github.com/apache/nuttx/pull/22500
## Summary Check TMPFS read EOF while holding the existing file lock. Reuse the unlock path when returning EOF so the size decision is serialized with file updates. ## Impact - Functionality: consistent TMPFS read results when another operation holds the file lock. - Compatibility: preserve the strict EOF comparison, file-position behavior and existing access-time behavior. No public API, Kconfig, hardware, driver, documentation or build-system changes. - Size: identical small sim configurations with TMPFS linked have text/data/bss deltas of -56/0/0 bytes. ## Testing I confirm that changes are verified on local setup and work as intended: - Linux x86_64, GCC 13.1.0, sim:nsh with assertions and TMPFS; nuttx-apps c621be657e. - Local bounded tests cover read/readv/file_read/file_readv, an in-range control, EOF, safe file growth while the file lock is held, data, file position, references and cleanup. - A semaphore handshake starts the reader; a bounded wait checks lock serialization. No shrinking race or memory-corruption reproduction is run on the baseline. Testing logs before change (0c45a2fc48b9): ```text TMPFSREADLOCK checks=198 failures=20 ``` Testing logs after change (9580f6ed6bf6), default and large-file/512 KiB FS heap configurations: ```text TMPFSREADLOCK checks=206 failures=0 ``` Eight additional completion checks execute when all readers wait for the lock. The baseline and branch use identical test source. Initial mountpoint/cleanup test preparation failures were corrected and the full comparison rerun; only the final comparison is reported above. Full-file and commit checkpatch, Make/CMake, OSTest and tested-HEAD gate pass. TMPFS-enabled protected qemu-armv7r:pnsh and kernel qemu-armv8a:knsh builds pass. No physical hardware, protected/kernel runtime, SMP stress or allocator-failure injection was tested. ## 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]
