Commit 8c01a529 authored by Linus Torvalds's avatar Linus Torvalds

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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 12f8ad4b
...@@ -1871,8 +1871,6 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent, ...@@ -1871,8 +1871,6 @@ struct dentry *__d_lookup_rcu(const struct dentry *parent,
seq = raw_seqcount_begin(&dentry->d_seq); seq = raw_seqcount_begin(&dentry->d_seq);
if (dentry->d_parent != parent) if (dentry->d_parent != parent)
continue; continue;
if (d_unhashed(dentry))
continue;
*seqp = seq; *seqp = seq;
if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) { if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment