pussuw commented on code in PR #16431: URL: https://github.com/apache/nuttx/pull/16431#discussion_r2104158434
########## fs/inode/fs_files.c: ########## @@ -476,14 +479,32 @@ void files_putlist(FAR struct filelist *list) * because there should not be any references in this context. */ +#ifdef CONFIG_FS_REFCOUNT +again: + loop = false; +#endif for (i = list->fl_rows - 1; i >= 0; i--) { for (j = CONFIG_NFILE_DESCRIPTORS_PER_BLOCK - 1; j >= 0; j--) { +#ifdef CONFIG_FS_REFCOUNT + if (fs_putfilep(&list->fl_files[i][j]) > 0) Review Comment: I don't agree with this at all. Whomever holds the reference should release it. Now if the kernel needs the file still because it's doing something with it on another CPU it will crash. -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org