Skip to content

Commit

Permalink
vfs: remove unnecessary d_unhashed() check from __d_lookup_rcu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linus Torvalds committed May 11, 2012
1 parent 12f8ad4 commit 8c01a52
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 8c01a52

Please sign in to comment.