Instead of checking for I_FREEING, check the refcount of the inode to see if it is alive. Signed-off-by: Josef Bacik --- fs/dcache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 60046ae23d51..3f3bd1373d92 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1072,8 +1072,8 @@ struct dentry *d_find_alias_rcu(struct inode *inode) spin_lock(&inode->i_lock); // ->i_dentry and ->i_rcu are colocated, but the latter won't be - // used without having I_FREEING set, which means no aliases left - if (likely(!(inode->i_state & I_FREEING) && !hlist_empty(l))) { + // used without having an i_count reference, which means no aliases left + if (likely(icount_read(inode) && !hlist_empty(l))) { if (S_ISDIR(inode->i_mode)) { de = hlist_entry(l->first, struct dentry, d_u.d_alias); } else { -- 2.49.0