]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/dcache.c
ENGR00296519 USB: EHCI: wait more than 3ms until the device enters full-speed idle
[karo-tx-linux.git] / fs / dcache.c
index 1792d6075b4f80ced75e04d17c02b8d362b51aac..06f65857a855725247c1190d243c0e19cccd8570 100644 (file)
@@ -532,10 +532,12 @@ static inline struct dentry *lock_parent(struct dentry *dentry)
        struct dentry *parent = dentry->d_parent;
        if (IS_ROOT(dentry))
                return NULL;
+       if (unlikely((int)dentry->d_lockref.count < 0))
+               return NULL;
        if (likely(spin_trylock(&parent->d_lock)))
                return parent;
-       spin_unlock(&dentry->d_lock);
        rcu_read_lock();
+       spin_unlock(&dentry->d_lock);
 again:
        parent = ACCESS_ONCE(dentry->d_parent);
        spin_lock(&parent->d_lock);