This is an automated email from the ASF dual-hosted git repository.
GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 96b16afe343 fs/mmap: stop msync when a write makes no progress
96b16afe343 is described below
commit 96b16afe343a298e9edbac2a7430949a90bada68
Author: jingfei <[email protected]>
AuthorDate: Fri Nov 27 16:48:55 2026 +0800
fs/mmap: stop msync when a write makes no progress
Return an error when a shared mapping writeback does not advance.
Signed-off-by: jingfei <[email protected]>
---
fs/mmap/fs_rammap.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/mmap/fs_rammap.c b/fs/mmap/fs_rammap.c
index 6a57f52cc0a..adb6275bc72 100644
--- a/fs/mmap/fs_rammap.c
+++ b/fs/mmap/fs_rammap.c
@@ -112,6 +112,13 @@ static int msync_rammap(FAR struct mm_map_entry_s *entry,
FAR void *start,
continue;
}
+ if (nwrite == 0)
+ {
+ ferr("ERROR: Write made no progress\n");
+ nwrite = -EIO;
+ break;
+ }
+
/* Increment number of bytes written */
wrbuffer += nwrite;