summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2022-12-07 09:43:08 +0100
committerChuck Lever <chuck.lever@oracle.com>2023-02-20 09:20:08 -0500
commite1f19857f94be09f9526f180e64f20138bd4e394 (patch)
tree00fcaade62f6251c0a2324b4e4489459fa6a9848 /fs
parent50f5fdaea9cd6941e51ea6e07d8c15265917bb86 (diff)
downloadlinux-stable-e1f19857f94be09f9526f180e64f20138bd4e394.tar.gz
linux-stable-e1f19857f94be09f9526f180e64f20138bd4e394.tar.bz2
linux-stable-e1f19857f94be09f9526f180e64f20138bd4e394.zip
fs: namei: Allow follow_down() to uncover auto mounts
This function is only used by NFSD to cross mount points. If a mount point is of type auto mount, follow_down() will not uncover it. Add LOOKUP_AUTOMOUNT to the lookup flags to have ->d_automount() called when NFSD walks down the mount tree. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Ian Kent <raven@themaw.net> Reviewed-by: Jeff Layton <jlayton@kernel.org> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c6
-rw-r--r--fs/nfsd/vfs.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 309ae6fc8c99..c06f47066063 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1458,11 +1458,11 @@ EXPORT_SYMBOL(follow_down_one);
* point, the filesystem owning that dentry may be queried as to whether the
* caller is permitted to proceed or not.
*/
-int follow_down(struct path *path)
+int follow_down(struct path *path, unsigned int flags)
{
struct vfsmount *mnt = path->mnt;
bool jumped;
- int ret = traverse_mounts(path, &jumped, NULL, 0);
+ int ret = traverse_mounts(path, &jumped, NULL, flags);
if (path->mnt != mnt)
mntput(mnt);
@@ -2864,7 +2864,7 @@ int path_pts(struct path *path)
path->dentry = child;
dput(parent);
- follow_down(path);
+ follow_down(path, 0);
return 0;
}
#endif
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 780856561bbb..21d5209f6e04 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -126,9 +126,13 @@ nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
struct dentry *dentry = *dpp;
struct path path = {.mnt = mntget(exp->ex_path.mnt),
.dentry = dget(dentry)};
+ unsigned int follow_flags = 0;
int err = 0;
- err = follow_down(&path);
+ if (exp->ex_flags & NFSEXP_CROSSMOUNT)
+ follow_flags = LOOKUP_AUTOMOUNT;
+
+ err = follow_down(&path, follow_flags);
if (err < 0)
goto out;
if (path.mnt == exp->ex_path.mnt && path.dentry == dentry &&