dcache: Fix locking bugs in backported "deal with deadlock in d_walk()"
[pandora-kernel.git] / fs / dcache.c
index 3f65742..8bc98af 100644 (file)
@@ -1035,7 +1035,7 @@ ascend:
        return 0; /* No mount points found in tree */
 positive:
        if (!locked && read_seqretry(&rename_lock, seq))
-               goto rename_retry;
+               goto rename_retry_unlocked;
        if (locked)
                write_sequnlock(&rename_lock);
        return 1;
@@ -1045,6 +1045,7 @@ rename_retry:
        rcu_read_unlock();
        if (locked)
                goto again;
+rename_retry_unlocked:
        locked = 1;
        write_seqlock(&rename_lock);
        goto again;
@@ -1109,6 +1110,7 @@ resume:
                 */
                if (found && need_resched()) {
                        spin_unlock(&dentry->d_lock);
+                       rcu_read_lock();
                        goto out;
                }