Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ian Kent and committed by
Linus Torvalds
49999ab2 14ffe009

+4 -2
+4 -2
fs/autofs4/root.c
··· 392 392 ino->flags |= AUTOFS_INF_PENDING; 393 393 spin_unlock(&sbi->fs_lock); 394 394 status = autofs4_mount_wait(dentry); 395 - if (status) 396 - return ERR_PTR(status); 397 395 spin_lock(&sbi->fs_lock); 398 396 ino->flags &= ~AUTOFS_INF_PENDING; 397 + if (status) { 398 + spin_unlock(&sbi->fs_lock); 399 + return ERR_PTR(status); 400 + } 399 401 } 400 402 done: 401 403 if (!(ino->flags & AUTOFS_INF_EXPIRING)) {