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

commit eb89c244f3d5539dae061b0d907fd96caf0d1209
Author: jingfei <[email protected]>
AuthorDate: Tue Nov 24 11:49:28 2026 +0800

    fs/tmpfs: do not resize the file on a partial munmap()
    
    munmap() of the tail of a tmpfs mapping called tmpfs_realloc_file()
    with the unmap offset, which truncated the file to that length.
    munmap() must not change the file; only shorten the mapping entry.
    
    Signed-off-by: jingfei <[email protected]>
---
 fs/tmpfs/fs_tmpfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c
index e081ba1c7f4..4d9d26cabd9 100644
--- a/fs/tmpfs/fs_tmpfs.c
+++ b/fs/tmpfs/fs_tmpfs.c
@@ -2231,9 +2231,7 @@ static int tmpfs_unmap(FAR struct task_group_s *group,
   else
     {
       entry->length = offset;
-      tmpfs_lock_file(tfo);
-      ret = tmpfs_realloc_file(tfo, offset);
-      tmpfs_unlock_file(tfo);
+      ret = OK;
     }
 
   return ret;

Reply via email to