autofs: use path_has_submounts() to fix unreliable have_submount() checks
authorIan Kent <ikent@redhat.com>
Wed, 23 Nov 2016 21:03:42 +0000 (08:03 +1100)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 4 Dec 2016 01:51:49 +0000 (20:51 -0500)
commit60359741473438f66fef7297d1fa2435640dbe79
tree3316c740550e8bd1ddc441385517e28d96e5468e
parentcfaf86ab6ccdf0acf47ebe474a4a844114bc0e10
autofs: use path_has_submounts() to fix unreliable have_submount() checks

If an automount mount is clone(2)ed into a file system that is propagation
private, when it later expires in the originating namespace, subsequent
calls to autofs ->d_automount() for that dentry in the original namespace
will return ELOOP until the mount is umounted in the cloned namespace.

Now that a struct path is available where needed use path_has_submounts()
instead of have_submounts() so we don't get false positives when checking
if a dentry is a mount point or contains mounts in the current namespace.

Link: http://lkml.kernel.org/r/20161011053423.27645.91233.stgit@pluto.themaw.net
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/autofs4/dev-ioctl.c
fs/autofs4/root.c
fs/autofs4/waitq.c