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

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a1a8848b8fdfa74ba4d75e61bde8b0a70850b060
Author: cuiziwei <[email protected]>
AuthorDate: Tue May 19 18:51:15 2026 +0800

    fs/wzipfs: add minimal stat implementation for rpmsgfs compatibility
    
    rpmsgfs_mkpath() calls stat() on fs_root to verify the remote path
    is reachable before proceeding. When the target path is on wzipfs
    (write-only), stat returns NULL handler causing rpmsgfs to enter a
    retry loop until timeout, effectively deadlocking the mount.
    
    Add a minimal stat() that always returns S_IFDIR for any path.
    Since wzipfs is write-only and does not track previously written
    entries, it cannot return real file metadata, but reporting the
    path as a directory is sufficient for rpmsgfs validation.
    
    Assisted-by: Claude Code:claude-sonnet-5.5
    Signed-off-by: cuiziwei <[email protected]>
    Signed-off-by: tengshuangshuang <[email protected]>
---
 fs/zipfs/wzip_vfs.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/fs/zipfs/wzip_vfs.c b/fs/zipfs/wzip_vfs.c
index c5f9a01041b..4f80cb5f617 100644
--- a/fs/zipfs/wzip_vfs.c
+++ b/fs/zipfs/wzip_vfs.c
@@ -88,6 +88,8 @@ static int wzipfs_statfs(FAR struct inode *mountpt,
                          FAR struct statfs *buf);
 static int wzipfs_mkdir(FAR struct inode *mountpt,
                         FAR const char *relpath, mode_t mode);
+static int wzipfs_stat(FAR struct inode *mountpt,
+                       FAR const char *relpath, FAR struct stat *buf);
 
 /****************************************************************************
  * Private Data
@@ -124,7 +126,7 @@ const struct mountpt_operations g_wzipfs_operations =
   wzipfs_mkdir,          /* mkdir */
   NULL,                  /* rmdir */
   NULL,                  /* rename */
-  NULL,                  /* stat   -- write-only FS */
+  wzipfs_stat,           /* stat */
   NULL                   /* chstat */
 };
 
@@ -694,3 +696,19 @@ static int wzipfs_mkdir(FAR struct inode *mountpt,
   return ret;
 }
 
+/****************************************************************************
+ * Name: wzipfs_stat
+ *
+ * Description:
+ *   Minimal stat for wzipfs. Always reports path as a writable directory
+ *   so that rpmsgfs can verify the mount root without blocking.
+ *
+ ****************************************************************************/
+
+static int wzipfs_stat(FAR struct inode *mountpt,
+                       FAR const char *relpath, FAR struct stat *buf)
+{
+  memset(buf, 0, sizeof(*buf));
+  buf->st_mode = S_IFDIR | 0755;
+  return 0;
+}

Reply via email to