diff --git a/fs/dcache.c b/fs/dcache.c index 525770e576db0db8085f5c3c2220095008cb2629..c2add37082b64936cb1239c187eb8a74cd352177 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -503,7 +503,12 @@ void __d_drop(struct dentry *dentry) { if (!d_unhashed(dentry)) { struct hlist_bl_head *b; - if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) + /* + * Hashed dentries are normally on the dentry hashtable, + * with the exception of those newly allocated by + * d_obtain_alias, which are always IS_ROOT: + */ + if (unlikely(IS_ROOT(dentry))) b = &dentry->d_sb->s_anon; else b = d_hash(dentry->d_parent, dentry->d_name.hash);