Merge branch 'work.autofs' into for-linus
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 16 Dec 2016 21:34:52 +0000 (16:34 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 16 Dec 2016 21:34:52 +0000 (16:34 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1  2 
fs/autofs4/dev-ioctl.c
fs/namei.c
fs/namespace.c
include/linux/mount.h

Simple merge
diff --cc fs/namei.c
Simple merge
diff --cc fs/namespace.c
index 9ad88a45b3e3b8ae6c3c89f15a07b049c9485f1f,7a73383e836574059d3503a2509633504ca7ed6e..f7e28f8ea04d2a629ae7c5ead8b84ca71913cc8a
@@@ -1159,7 -1159,36 +1159,36 @@@ struct vfsmount *mntget(struct vfsmoun
  }
  EXPORT_SYMBOL(mntget);
  
 -struct vfsmount *mnt_clone_internal(struct path *path)
+ /* path_is_mountpoint() - Check if path is a mount in the current
+  *                          namespace.
+  *
+  *  d_mountpoint() can only be used reliably to establish if a dentry is
+  *  not mounted in any namespace and that common case is handled inline.
+  *  d_mountpoint() isn't aware of the possibility there may be multiple
+  *  mounts using a given dentry in a different namespace. This function
+  *  checks if the passed in path is a mountpoint rather than the dentry
+  *  alone.
+  */
+ bool path_is_mountpoint(const struct path *path)
+ {
+       unsigned seq;
+       bool res;
+       if (!d_mountpoint(path->dentry))
+               return false;
+       rcu_read_lock();
+       do {
+               seq = read_seqbegin(&mount_lock);
+               res = __path_is_mountpoint(path);
+       } while (read_seqretry(&mount_lock, seq));
+       rcu_read_unlock();
+       return res;
+ }
+ EXPORT_SYMBOL(path_is_mountpoint);
 +struct vfsmount *mnt_clone_internal(const struct path *path)
  {
        struct mount *p;
        p = clone_mnt(real_mount(path->mnt), path->dentry, CL_PRIVATE);
Simple merge