From 8c01a529b861ba97c7d78368e6a5d4d42e946f75 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 10 May 2012 11:06:18 -0700 Subject: [PATCH] vfs: remove unnecessary d_unhashed() check from __d_lookup_rcu The check for d_unhashed() is not strictly incorrect, but at the same time it is also not sensible. The actual dentry removal from the dentry hash chains is totally asynchronous to the __d_lookup_rcu() logic, and we depend on __d_drop() updating the sequence number to invalidate any lookup of an unhashed dentry. So checking d_unhashed() is not incorrect, but it's not useful either: the code has to work correctly even without it. So just remove it. Signed-off-by: Linus Torvalds --- fs/dcache.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c index 539943eb442c..c4d2ff8b4912 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1871,8 +1871,6 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent, seq = raw_seqcount_begin(&dentry->d_seq); if (dentry->d_parent != parent) continue; - if (d_unhashed(dentry)) - continue; *seqp = seq; if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) {