|
@@ -532,10 +532,12 @@ static inline struct dentry *lock_parent(struct dentry *dentry)
|
|
|
struct dentry *parent = dentry->d_parent;
|
|
struct dentry *parent = dentry->d_parent;
|
|
|
if (IS_ROOT(dentry))
|
|
if (IS_ROOT(dentry))
|
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
+ if (unlikely((int)dentry->d_lockref.count < 0))
|
|
|
|
|
+ return NULL;
|
|
|
if (likely(spin_trylock(&parent->d_lock)))
|
|
if (likely(spin_trylock(&parent->d_lock)))
|
|
|
return parent;
|
|
return parent;
|
|
|
- spin_unlock(&dentry->d_lock);
|
|
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
|
|
|
+ spin_unlock(&dentry->d_lock);
|
|
|
again:
|
|
again:
|
|
|
parent = ACCESS_ONCE(dentry->d_parent);
|
|
parent = ACCESS_ONCE(dentry->d_parent);
|
|
|
spin_lock(&parent->d_lock);
|
|
spin_lock(&parent->d_lock);
|