On Wed, Jul 09, 2025 at 11:06:36AM +0200, Jan Kara wrote: > evict_inodes() uses list_for_each_entry_safe() to iterate sb->s_inodes > list. However, since we use i_lru list entry for our local temporary > list of inodes to destroy, the inode is guaranteed to stay in > sb->s_inodes list while we hold sb->s_inode_list_lock. So there is no > real need for safe iteration variant and we can use > list_for_each_entry() just fine. Yes, agreed, this is safe. I thought it wasn't, because (a) we call inode_lru_list_del(), but that's a different list (i_lru, not i_sb_list) and (b) we call dispose() which calls evict(), but if we do that, we restart the list walk. > Signed-off-by: Jan Kara <jack@xxxxxxx> Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>