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 154e6ecea05 fs/tmpfs: unlock filesystem on statfs traversal failure
154e6ecea05 is described below

commit 154e6ecea05fec13b43eac82aa8115a2ddaa095b
Author: chao an <[email protected]>
AuthorDate: Wed Oct 21 11:45:01 2026 +0800

    fs/tmpfs: unlock filesystem on statfs traversal failure
    
    tmpfs_statfs() holds the tmpfs lock while walking the filesystem to
    accumulate usage statistics.  If tmpfs_foreach() fails, the error path
    returned immediately without releasing the lock.
    
    Unlock the filesystem before returning the failure so later tmpfs
    operations are not blocked by the leaked lock.
    
    Signed-off-by: chao an <[email protected]>
---
 fs/tmpfs/fs_tmpfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c
index 5df8d369b7d..51173964ed7 100644
--- a/fs/tmpfs/fs_tmpfs.c
+++ b/fs/tmpfs/fs_tmpfs.c
@@ -2650,6 +2650,7 @@ static int tmpfs_statfs(FAR struct inode *mountpt, FAR 
struct statfs *buf)
   ret = tmpfs_foreach(tdo, tmpfs_statfs_callout, (FAR void *)&tmpbuf);
   if (ret < 0)
     {
+      tmpfs_unlock(fs);
       return -ECANCELED;
     }
 

Reply via email to