summaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2019-04-24 17:46:43 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-04-26 16:11:54 -0400
commit1a58e8a0e5c1f188a80eb9e505bc77d78a31a4ec (patch)
tree0dc31db3ea8ca7ac3b598a7d7fef30a6496b23ac /fs/nfs/client.c
parent79caa5fad47c69874f9efc4ac3128cc3f6d36f6e (diff)
downloadlinux-1a58e8a0e5c1f188a80eb9e505bc77d78a31a4ec.tar.gz
linux-1a58e8a0e5c1f188a80eb9e505bc77d78a31a4ec.tar.bz2
linux-1a58e8a0e5c1f188a80eb9e505bc77d78a31a4ec.zip
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/client.c')
-rw-r--r--fs/nfs/client.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index a843cf3f6340..e3baa9f1da76 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -500,7 +500,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
.program = &nfs_program,
.version = clp->rpc_ops->version,
.authflavor = flavor,
- .cred = current_cred(),
+ .cred = cl_init->cred,
};
if (test_bit(NFS_CS_DISCRTRY, &clp->cl_flags))
@@ -655,6 +655,7 @@ static int nfs_init_server(struct nfs_server *server,
.proto = data->nfs_server.protocol,
.net = data->net,
.timeparms = &timeparms,
+ .cred = server->cred,
};
struct nfs_client *clp;
int error;
@@ -923,6 +924,7 @@ void nfs_free_server(struct nfs_server *server)
ida_destroy(&server->lockowner_id);
ida_destroy(&server->openowner_id);
nfs_free_iostats(server->io_stats);
+ put_cred(server->cred);
kfree(server);
nfs_release_automount_timer();
}
@@ -943,6 +945,8 @@ struct nfs_server *nfs_create_server(struct nfs_mount_info *mount_info,
if (!server)
return ERR_PTR(-ENOMEM);
+ server->cred = get_cred(current_cred());
+
error = -ENOMEM;
fattr = nfs_alloc_fattr();
if (fattr == NULL)
@@ -1009,6 +1013,8 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,
if (!server)
return ERR_PTR(-ENOMEM);
+ server->cred = get_cred(source->cred);
+
error = -ENOMEM;
fattr_fsinfo = nfs_alloc_fattr();
if (fattr_fsinfo == NULL)