OSDN Git Service

Merge 4.4.123 into android-4.4
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / dcache.c
index 5bf7b4a..4d43df7 100644 (file)
@@ -634,11 +634,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;
 }