pussuw commented on code in PR #16431: URL: https://github.com/apache/nuttx/pull/16431#discussion_r2104343400
########## 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 mean another CPU can be performing a write operation while another CPU exit()'s the process. This is userspace racing against itself. The kernel must be able to endure this. ########## 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 mean another CPU can be performing a write/read/whatever operation while another CPU exit()'s the process. This is userspace racing against itself. The kernel must be able to endure this. -- 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