diff options
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 1dcee1fd32d9..c74e4538d0eb 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -844,18 +844,15 @@ static int max_cb_time(struct net *net) | |||
844 | return max(nn->nfsd4_lease/10, (time_t)1) * HZ; | 844 | return max(nn->nfsd4_lease/10, (time_t)1) * HZ; |
845 | } | 845 | } |
846 | 846 | ||
847 | static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, struct nfsd4_session *ses) | 847 | static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, struct nfsd4_session *ses) |
848 | { | 848 | { |
849 | if (clp->cl_minorversion == 0) { | 849 | if (clp->cl_minorversion == 0) { |
850 | client->cl_principal = clp->cl_cred.cr_targ_princ ? | 850 | client->cl_principal = clp->cl_cred.cr_targ_princ ? |
851 | clp->cl_cred.cr_targ_princ : "nfs"; | 851 | clp->cl_cred.cr_targ_princ : "nfs"; |
852 | 852 | ||
853 | return get_rpccred(rpc_machine_cred()); | 853 | return get_cred(rpc_machine_cred()); |
854 | } else { | 854 | } else { |
855 | struct rpc_auth *auth = client->cl_auth; | ||
856 | struct auth_cred acred = {}; | ||
857 | struct cred *kcred; | 855 | struct cred *kcred; |
858 | struct rpc_cred *ret; | ||
859 | 856 | ||
860 | kcred = prepare_kernel_cred(NULL); | 857 | kcred = prepare_kernel_cred(NULL); |
861 | if (!kcred) | 858 | if (!kcred) |
@@ -863,10 +860,7 @@ static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc | |||
863 | 860 | ||
864 | kcred->uid = ses->se_cb_sec.uid; | 861 | kcred->uid = ses->se_cb_sec.uid; |
865 | kcred->gid = ses->se_cb_sec.gid; | 862 | kcred->gid = ses->se_cb_sec.gid; |
866 | acred.cred = kcred; | 863 | return kcred; |
867 | ret = auth->au_ops->lookup_cred(client->cl_auth, &acred, 0); | ||
868 | put_cred(kcred); | ||
869 | return ret; | ||
870 | } | 864 | } |
871 | } | 865 | } |
872 | 866 | ||
@@ -889,7 +883,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c | |||
889 | .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), | 883 | .flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET), |
890 | }; | 884 | }; |
891 | struct rpc_clnt *client; | 885 | struct rpc_clnt *client; |
892 | struct rpc_cred *cred; | 886 | const struct cred *cred; |
893 | 887 | ||
894 | if (clp->cl_minorversion == 0) { | 888 | if (clp->cl_minorversion == 0) { |
895 | if (!clp->cl_cred.cr_principal && | 889 | if (!clp->cl_cred.cr_principal && |
@@ -1219,7 +1213,7 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) | |||
1219 | if (clp->cl_cb_client) { | 1213 | if (clp->cl_cb_client) { |
1220 | rpc_shutdown_client(clp->cl_cb_client); | 1214 | rpc_shutdown_client(clp->cl_cb_client); |
1221 | clp->cl_cb_client = NULL; | 1215 | clp->cl_cb_client = NULL; |
1222 | put_rpccred(clp->cl_cb_cred); | 1216 | put_cred(clp->cl_cb_cred); |
1223 | clp->cl_cb_cred = NULL; | 1217 | clp->cl_cb_cred = NULL; |
1224 | } | 1218 | } |
1225 | if (clp->cl_cb_conn.cb_xprt) { | 1219 | if (clp->cl_cb_conn.cb_xprt) { |