diff options
author | Trond Myklebust <trondmy@gmail.com> | 2019-04-24 17:46:43 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2019-04-26 16:11:54 -0400 |
commit | 1a58e8a0e5c1f188a80eb9e505bc77d78a31a4ec (patch) | |
tree | 0dc31db3ea8ca7ac3b598a7d7fef30a6496b23ac /fs/nfs/nfs4client.c | |
parent | 79caa5fad47c69874f9efc4ac3128cc3f6d36f6e (diff) |
NFS: Store the credential of the mount process in the nfs_server
Store the credential of the mount process so that we can determine
information such as the user namespace.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/nfs4client.c')
-rw-r--r-- | fs/nfs/nfs4client.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 1339ede979af..3ce246346f02 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c | |||
@@ -870,6 +870,7 @@ static int nfs4_set_client(struct nfs_server *server, | |||
870 | .minorversion = minorversion, | 870 | .minorversion = minorversion, |
871 | .net = net, | 871 | .net = net, |
872 | .timeparms = timeparms, | 872 | .timeparms = timeparms, |
873 | .cred = server->cred, | ||
873 | }; | 874 | }; |
874 | struct nfs_client *clp; | 875 | struct nfs_client *clp; |
875 | 876 | ||
@@ -931,6 +932,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv, | |||
931 | .minorversion = minor_version, | 932 | .minorversion = minor_version, |
932 | .net = mds_clp->cl_net, | 933 | .net = mds_clp->cl_net, |
933 | .timeparms = &ds_timeout, | 934 | .timeparms = &ds_timeout, |
935 | .cred = mds_srv->cred, | ||
934 | }; | 936 | }; |
935 | char buf[INET6_ADDRSTRLEN + 1]; | 937 | char buf[INET6_ADDRSTRLEN + 1]; |
936 | 938 | ||
@@ -1107,6 +1109,8 @@ struct nfs_server *nfs4_create_server(struct nfs_mount_info *mount_info, | |||
1107 | if (!server) | 1109 | if (!server) |
1108 | return ERR_PTR(-ENOMEM); | 1110 | return ERR_PTR(-ENOMEM); |
1109 | 1111 | ||
1112 | server->cred = get_cred(current_cred()); | ||
1113 | |||
1110 | auth_probe = mount_info->parsed->auth_info.flavor_len < 1; | 1114 | auth_probe = mount_info->parsed->auth_info.flavor_len < 1; |
1111 | 1115 | ||
1112 | /* set up the general RPC client */ | 1116 | /* set up the general RPC client */ |
@@ -1143,6 +1147,8 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, | |||
1143 | parent_server = NFS_SB(data->sb); | 1147 | parent_server = NFS_SB(data->sb); |
1144 | parent_client = parent_server->nfs_client; | 1148 | parent_client = parent_server->nfs_client; |
1145 | 1149 | ||
1150 | server->cred = get_cred(parent_server->cred); | ||
1151 | |||
1146 | /* Initialise the client representation from the parent server */ | 1152 | /* Initialise the client representation from the parent server */ |
1147 | nfs_server_copy_userdata(server, parent_server); | 1153 | nfs_server_copy_userdata(server, parent_server); |
1148 | 1154 | ||