Use list_for_each_entry_safe() instead of list_for_each_entry() when closing
staging file descriptors, since a lookup table entry may be deleted when its
last file descriptor is closed.
DEBUG("Closing all staging file descriptors.");
DEBUG("Closing all staging file descriptors.");
- list_for_each_entry(lte, &ctx->staging_list, staging_list) {
+ list_for_each_entry_safe(lte, tmp, &ctx->staging_list, staging_list) {
ret = inode_close_fds(lte->lte_inode);
if (ret != 0)
return ret;
ret = inode_close_fds(lte->lte_inode);
if (ret != 0)
return ret;