]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - include/linux/dcache.h
vfs: add path_has_submounts()
authorIan Kent <ikent@redhat.com>
Wed, 23 Nov 2016 21:03:41 +0000 (08:03 +1100)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 4 Dec 2016 01:51:47 +0000 (20:51 -0500)
commit01619491a5f0766014fe863c5ae480665436e7a2
treee9f8f4fcf30337b805c76f8fcc83baa517779359
parentc6609c0a1c34fc097152b28b496236625673924f
vfs: add path_has_submounts()

d_mountpoint() can only be used reliably to establish if a dentry is
not mounted in any namespace. It isn't aware of the possibility there
may be multiple mounts using the given dentry, possibly in a different
namespace.

Add function, path_has_submounts(), that checks is a struct path contains
mounts (or is a mountpoint itself) to handle this case.

Link: http://lkml.kernel.org/r/20161011053403.27645.55242.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/dcache.c
include/linux/dcache.h