Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / fs / autofs4 / root.c
index f55ae23..2e936c6 100644 (file)
@@ -392,10 +392,12 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
                ino->flags |= AUTOFS_INF_PENDING;
                spin_unlock(&sbi->fs_lock);
                status = autofs4_mount_wait(dentry);
-               if (status)
-                       return ERR_PTR(status);
                spin_lock(&sbi->fs_lock);
                ino->flags &= ~AUTOFS_INF_PENDING;
+               if (status) {
+                       spin_unlock(&sbi->fs_lock);
+                       return ERR_PTR(status);
+               }
        }
 done:
        if (!(ino->flags & AUTOFS_INF_EXPIRING)) {
@@ -649,7 +651,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry)
        /* only consider parents below dentrys in the root */
        if (IS_ROOT(parent->d_parent))
                return;
-       d_child = &dentry->d_u.d_child;
+       d_child = &dentry->d_child;
        /* Set parent managed if it's becoming empty */
        if (d_child->next == &parent->d_subdirs &&
            d_child->prev == &parent->d_subdirs)