casaroli opened a new pull request, #20726: URL: https://github.com/apache/nuttx/pull/20726
## Summary With `CONFIG_FS_RAMMAP`, `mmap()` of a file on a file system without its own mmap copies the file into memory. `munmap()` freed that copy without writing it back, so changes made through a `MAP_SHARED`, `PROT_WRITE` mapping were lost, while POSIX says they reach the file. `msync()` wrote them, but programs that map a file, change it and unmap it do not call `msync()`. `munmap()` of a shared, writable mapping now writes the unmapped range back to the file first. Private mappings are not written. ## Impact `CONFIG_FS_RAMMAP` only. ## Testing Builds: `qemu-armv8a:nsh`, `qemu-armv8a:knsh`, `lm3s6965-ek:qemu-flat`. `tools/checkpatch.sh -c -u -m -g` passes. On `qemu-armv8a:knsh` with `CONFIG_FS_RAMMAP`: a program that maps a file `MAP_SHARED`, writes it through the mapping and unmaps it left the file unchanged before; with the change the file has the new data. -- 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]
