Re: [PATCH] vfs: Remove unnecessary list_for_each_entry_safe() from evict_inodes()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux