Skip to contentSkip to conversation

autofs4 - fix reset pending flag on mount fail

PATCH New Ian Kent 1 participant 1 message Oct 11, 2012

Subsystems (2)
lore
Share & tools
lore

Ian Kent

author
#0 lore raw

PATCH 1/1 autofs4 - fix reset pending flag on mount fail

From: Ian Kent <[email protected]>

In autofs4_d_automount(), if a mount fail occurs the AUTOFS_INF_PENDING mount pending flag is not cleared.

One effect of this is when using the "browse" option, directory entry attributes show up with all "?"s due to the incorrect callback and subsequent failure return (when in fact no callback should be made).

---

 0 files changed, 0 insertions(+), 0 deletions(-)
fs/autofs4/root.c +4 -2
index e7396cf..91b1165 100644
@@ -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)) {