anchao opened a new pull request, #20854:
URL: https://github.com/apache/nuttx/pull/20854

   ## Summary                                                                 
                                                                              
   Fix a lock leak in `tmpfs_statfs()` when filesystem traversal fails.       
                                                                              
   `tmpfs_statfs()` locks the tmpfs instance before walking the filesystem    
   with `tmpfs_foreach()` to accumulate usage statistics. If `tmpfs_foreach()`
   returns an error, the previous error path returned immediately without     
   releasing the tmpfs lock.                                                  
                                                                              
   This change unlocks the filesystem before returning the failure.           
                                                                              
   ## Impact                                                                  
                                                                              
   Without this fix, a failed `statfs()` traversal can leave the tmpfs lock   
   held permanently. Later tmpfs operations may then block or deadlock when   
   trying to acquire the same lock.                                           
                                                                              
   The success path is unchanged.                                             
                                                                              
   ## Testing                                                                 
                                                                              
   sim/nsh
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to