diff --git a/fs/inode.c b/fs/inode.c index 00b804e..c46c92e 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -419,6 +419,8 @@ void inode_add_lru(struct inode *inode) static void inode_lru_list_del(struct inode *inode) { + if (inode->i_state & I_FREEING) + return; if (list_lru_del(&inode->i_sb->s_inode_lru, &inode->i_lru)) this_cpu_dec(nr_unused); @@ -1381,9 +1383,8 @@ static void iput_final(struct inode *inode) inode->i_state &= ~I_WILL_FREE; } + inode_lru_list_del(inode); inode->i_state |= I_FREEING; - if (!list_empty(&inode->i_lru)) - inode_lru_list_del(inode); spin_unlock(&inode->i_lock); evict(inode);