xiaoxiang781216 commented on code in PR #15202:
URL: https://github.com/apache/nuttx/pull/15202#discussion_r1886242102
##########
fs/inode/fs_files.c:
##########
@@ -76,17 +76,15 @@ static FAR struct file *files_fget_by_index(FAR struct
filelist *list,
filep = &list->fl_files[l1][l2];
#ifdef CONFIG_FS_REFCOUNT
- int32_t refs = 0;
-
if (filep->f_inode != NULL)
{
/* When the reference count is zero but the inode has not yet been
* released, At this point we should return a null pointer
*/
+ int32_t refs = atomic_read(&filep->f_refs);
Review Comment:
no, atomic_try_cmpxchg will update the latest value to the second argument.
--
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]