Skip to content

Commit 49999ab

Browse files
raven-autorvalds
authored andcommitted
autofs4 - fix reset pending flag on mount fail
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). Signed-off-by: Ian Kent <ikent@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 14ffe00 commit 49999ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/autofs4/root.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,12 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
392392
ino->flags |= AUTOFS_INF_PENDING;
393393
spin_unlock(&sbi->fs_lock);
394394
status = autofs4_mount_wait(dentry);
395-
if (status)
396-
return ERR_PTR(status);
397395
spin_lock(&sbi->fs_lock);
398396
ino->flags &= ~AUTOFS_INF_PENDING;
397+
if (status) {
398+
spin_unlock(&sbi->fs_lock);
399+
return ERR_PTR(status);
400+
}
399401
}
400402
done:
401403
if (!(ino->flags & AUTOFS_INF_EXPIRING)) {

0 commit comments

Comments
 (0)