This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 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 39dabe979eb fs/mmap: Retry rammap I/O after signal interruption
39dabe979eb is described below

commit 39dabe979ebc196dff315fc6b22bb865767fdeb0
Author: chao an <[email protected]>
AuthorDate: Wed Oct 28 14:15:48 2026 +0800

    fs/mmap: Retry rammap I/O after signal interruption
    
    rammap() and msync_rammap() treat -EINTR as a retryable file I/O result,
    but still advanced the transfer buffer and remaining length afterwards. 
Since
    -EINTR is negative, that can move the buffer backwards and increase the
    remaining length.
    
    Retry interrupted reads and writes without updating the transfer state.
    
    Signed-off-by: chao an <[email protected]>
---
 fs/mmap/fs_rammap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/mmap/fs_rammap.c b/fs/mmap/fs_rammap.c
index eead13397e5..57f19232984 100644
--- a/fs/mmap/fs_rammap.c
+++ b/fs/mmap/fs_rammap.c
@@ -103,6 +103,8 @@ static int msync_rammap(FAR struct mm_map_entry_s *entry, 
FAR void *start,
                    entry->offset, nwrite);
               break;
             }
+
+          continue;
         }
 
       /* Increment number of bytes written */
@@ -322,6 +324,8 @@ int rammap(FAR struct file *filep, FAR struct 
mm_map_entry_s *entry,
               ret = nread;
               goto errout_with_region;
             }
+
+          continue;
         }
 
       /* Check for end of file. */

Reply via email to