jingfei195887 opened a new pull request, #22480:
URL: https://github.com/apache/nuttx/pull/22480

   ## Summary
   
   `msync_rammap()` can receive a zero-byte result for a non-empty write and 
leave the remaining length unchanged. Return `EIO` when writeback makes no 
progress.
   
   ## Impact
   
   - Functionality: shared RAM mappings report a writeback error instead of 
retrying without progress. Positive short writes and interrupted writes retain 
their existing handling.
   - Compatibility: no API, configuration, build-system, documentation, or 
hardware changes.
   
   ## 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 `CONFIG_FS_RAMMAP` 
enabled. The baseline and fixed run use nuttx-apps `c621be657e`.
   - A local character driver returns zero once for a non-empty write, then 
accepts writes. The regression checks the `EIO` result after one write attempt, 
restored file position, mapping cleanup, and driver cleanup.
   
   Testing logs before change (`43603190c7c`):
   ```text
   MSYNCZERO RESULT checks=10 failures=2 writes=3
   ```
   
   Testing logs after change (`f958821c8d2`):
   ```text
   MSYNCZERO RESULT checks=10 failures=0 writes=2
   ```
   
   The final Make/CMake/OSTest/checkpatch gate passes on `f958821c8d2`. 
Protected and kernel builds pass with `CONFIG_FS_RAMMAP` enabled:
   ```text
   qemu-armv7r:pnsh build PASS
   qemu-armv8a:knsh build PASS
   ```
   
   In an identical `sim:nsh` small configuration with `CONFIG_FS_RAMMAP`, text 
is 550813 bytes, data is 2800 bytes, and bss is 12896 bytes on both baseline 
and branch. The regression application is disabled for this size comparison.
   
   Upstream advanced by 12 commits during final verification. Those commits 
touch board, network, and ESP32S3 paths; none overlap this change's 
`fs/mmap/fs_rammap.c` path.
   
   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] My PR adheres to the Contributing Guidelines and Documentation.
   - [ ] My PR is still work in progress (not ready for review).
   - [x] My PR is ready for review and can be safely merged into a codebase.
   


-- 
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]

Reply via email to