NFS: Don't hard-code the fs_type when submounting
authorScott Mayhew <smayhew@redhat.com>
Thu, 20 Feb 2020 13:06:20 +0000 (08:06 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 25 Feb 2020 18:31:19 +0000 (13:31 -0500)
Hard-coding the fstype causes "nfs4" mounts to appear as "nfs",
which breaks scripts that do "umount -at nfs4".

Reported-by: Patrick Steinhardt <ps@pks.im>
Fixes: f2aedb713c28 ("NFS: Add fs_context support.")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/namespace.c

index ad60774049473d3f600267282c275f217aa68510..f3ece8ed32033ab3e4e4e807b9b128b54c1da95a 100644 (file)
@@ -153,7 +153,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
        /* Open a new filesystem context, transferring parameters from the
         * parent superblock, including the network namespace.
         */
-       fc = fs_context_for_submount(&nfs_fs_type, path->dentry);
+       fc = fs_context_for_submount(path->mnt->mnt_sb->s_type, path->dentry);
        if (IS_ERR(fc))
                return ERR_CAST(fc);