From 646f2994360e135f3ea1acb2d68a45e1e0a728ce Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 29 Sep 2008 07:42:57 -0700 Subject: [PATCH] --- yaml --- r: 110048 b: refs/heads/master c: d0185c0882d76b8126d4a099c7ac82b3b216d103 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/dcache.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 95bf9aacacaf..176faeed0f56 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 94715da3633d8abd63376b47c7120df59a69055e +refs/heads/master: d0185c0882d76b8126d4a099c7ac82b3b216d103 diff --git a/trunk/fs/dcache.c b/trunk/fs/dcache.c index 80e93956aced..e7a1a99b7464 100644 --- a/trunk/fs/dcache.c +++ b/trunk/fs/dcache.c @@ -1395,6 +1395,10 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name) if (dentry->d_parent != parent) goto next; + /* non-existing due to RCU? */ + if (d_unhashed(dentry)) + goto next; + /* * It is safe to compare names since d_move() cannot * change the qstr (protected by d_lock). @@ -1410,10 +1414,8 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name) goto next; } - if (!d_unhashed(dentry)) { - atomic_inc(&dentry->d_count); - found = dentry; - } + atomic_inc(&dentry->d_count); + found = dentry; spin_unlock(&dentry->d_lock); break; next: