NFSD: Teach nfsd_mountpoint() auto mounts
authorRichard Weinberger <richard@nod.at>
Wed, 7 Dec 2022 08:43:07 +0000 (09:43 +0100)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 20 Feb 2023 14:20:08 +0000 (09:20 -0500)
Currently nfsd_mountpoint() tests for mount points using d_mountpoint(),
this works only when a mount point is already uncovered.
In our case the mount point is of type auto mount and can be coverted.
i.e. ->d_automount() was not called.

Using d_managed() nfsd_mountpoint() can test whether a mount point is
either already uncovered or can be uncovered later.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Ian Kent <raven@themaw.net>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/vfs.c

index 4c3a0d84043c9b2c4fc2088640ba6c9a6e8f5920..780856561bbba7d56cf2c15066433d94d5dfa4a4 100644 (file)
@@ -223,7 +223,7 @@ int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp)
                return 1;
        if (nfsd4_is_junction(dentry))
                return 1;
-       if (d_mountpoint(dentry))
+       if (d_managed(dentry))
                /*
                 * Might only be a mountpoint in a different namespace,
                 * but we need to check.