aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2013-09-10 18:44:31 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-11 09:07:27 -0400
commit7cb852dfc858e9ab092cbbfcb3e57bae4aa7f56a (patch)
tree506ca48bbb01e1aacb6c40dbfdf9e5d571319704 /fs/nfs/nfs4proc.c
parenta02796250fe3e5fd053f33d90c1b3471617188a9 (diff)
NFSv4.1: fix SECINFO* use of put_rpccred
Recent SP4_MACH_CRED changes allows rpc_message.rpc_cred to change, so keep a separate pointer to the machine cred for put_rpccred. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4aeb14e902d9..4b6a2f05b335 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6003,10 +6003,12 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct
6003 .rpc_resp = &res, 6003 .rpc_resp = &res,
6004 }; 6004 };
6005 struct rpc_clnt *clnt = NFS_SERVER(dir)->client; 6005 struct rpc_clnt *clnt = NFS_SERVER(dir)->client;
6006 struct rpc_cred *cred = NULL;
6006 6007
6007 if (use_integrity) { 6008 if (use_integrity) {
6008 clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient; 6009 clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient;
6009 msg.rpc_cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client); 6010 cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client);
6011 msg.rpc_cred = cred;
6010 } 6012 }
6011 6013
6012 dprintk("NFS call secinfo %s\n", name->name); 6014 dprintk("NFS call secinfo %s\n", name->name);
@@ -6018,8 +6020,8 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct
6018 &res.seq_res, 0); 6020 &res.seq_res, 0);
6019 dprintk("NFS reply secinfo: %d\n", status); 6021 dprintk("NFS reply secinfo: %d\n", status);
6020 6022
6021 if (msg.rpc_cred) 6023 if (cred)
6022 put_rpccred(msg.rpc_cred); 6024 put_rpccred(cred);
6023 6025
6024 return status; 6026 return status;
6025} 6027}
@@ -7500,11 +7502,13 @@ _nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
7500 .rpc_resp = &res, 7502 .rpc_resp = &res,
7501 }; 7503 };
7502 struct rpc_clnt *clnt = server->client; 7504 struct rpc_clnt *clnt = server->client;
7505 struct rpc_cred *cred = NULL;
7503 int status; 7506 int status;
7504 7507
7505 if (use_integrity) { 7508 if (use_integrity) {
7506 clnt = server->nfs_client->cl_rpcclient; 7509 clnt = server->nfs_client->cl_rpcclient;
7507 msg.rpc_cred = nfs4_get_clid_cred(server->nfs_client); 7510 cred = nfs4_get_clid_cred(server->nfs_client);
7511 msg.rpc_cred = cred;
7508 } 7512 }
7509 7513
7510 dprintk("--> %s\n", __func__); 7514 dprintk("--> %s\n", __func__);
@@ -7512,8 +7516,8 @@ _nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
7512 &res.seq_res, 0); 7516 &res.seq_res, 0);
7513 dprintk("<-- %s status=%d\n", __func__, status); 7517 dprintk("<-- %s status=%d\n", __func__, status);
7514 7518
7515 if (msg.rpc_cred) 7519 if (cred)
7516 put_rpccred(msg.rpc_cred); 7520 put_rpccred(cred);
7517 7521
7518 return status; 7522 return status;
7519} 7523}