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

xiaoxiang781216 pushed a commit to branch releases/13.1
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 316bb443f01c2ac9e758757e0f279696632698f2
Author: Marco Casaroli <[email protected]>
AuthorDate: Mon Oct 12 18:35:17 2026 +0200

    fs/v9fs: Send the mode bits, not open flags, in Tsetattr.
    
    v9fs_client_chstat() converted st_mode with v9fs_map_open_flags(),
    which maps the O_* flags of open().  chmod() on a v9fs file set a
    wrong mode: 755 gave 701, 644 gave 600 and 777 gave 700.
    
    Send the permission bits of st_mode.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 fs/v9fs/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/v9fs/client.c b/fs/v9fs/client.c
index ac724800cbb..0e190838cc5 100644
--- a/fs/v9fs/client.c
+++ b/fs/v9fs/client.c
@@ -898,7 +898,7 @@ int v9fs_client_chstat(FAR struct v9fs_client_s *client, 
uint32_t fid,
 
   request.fid = fid;
   request.valid = v9fs_map_setattr_flags(flags);
-  request.mode = v9fs_map_open_flags(buf->st_mode);
+  request.mode = buf->st_mode & 07777;
   request.uid = buf->st_uid;
   request.gid = buf->st_gid;
   request.size = buf->st_size;

Reply via email to