diff options
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index ae7106123047..c064eea24c4a 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -581,11 +581,16 @@ again: spin_unlock(&parent->d_lock); goto again; } - rcu_read_unlock(); - if (parent != dentry) + if (parent != dentry) { spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); - else + if (unlikely(dentry->d_lockref.count < 0)) { + spin_unlock(&parent->d_lock); + parent = NULL; + } + } else { parent = NULL; + } + rcu_read_unlock(); return parent; } |