vfs: remove unnecessary d_unhashed() check from __d_lookup_rcu
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 May 2012 18:06:18 +0000 (11:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 May 2012 02:52:35 +0000 (19:52 -0700)
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 <torvalds@linux-foundation.org>
fs/dcache.c

index 539943eb442c35b81b69db8e1312ca07dee3fcbd..c4d2ff8b49129127c198de8f8e51ed5d2c8eb524 100644 (file)
@@ -1871,8 +1871,6 @@ seqretry:
                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)) {