aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 20c3bb06763a..90a17cc3ebc9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -4950,11 +4950,24 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
4950 goto out; 4950 goto out;
4951 } 4951 }
4952 4952
4953 res.impl_id = kzalloc(sizeof(struct nfs41_impl_id), GFP_KERNEL);
4954 if (unlikely(!res.impl_id)) {
4955 status = -ENOMEM;
4956 goto out_server_scope;
4957 }
4958
4953 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); 4959 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
4954 if (!status) 4960 if (!status)
4955 status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); 4961 status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags);
4956 4962
4957 if (!status) { 4963 if (!status) {
4964 /* use the most recent implementation id */
4965 kfree(clp->impl_id);
4966 clp->impl_id = res.impl_id;
4967 } else
4968 kfree(res.impl_id);
4969
4970 if (!status) {
4958 if (clp->server_scope && 4971 if (clp->server_scope &&
4959 !nfs41_same_server_scope(clp->server_scope, 4972 !nfs41_same_server_scope(clp->server_scope,
4960 res.server_scope)) { 4973 res.server_scope)) {
@@ -4970,8 +4983,16 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
4970 goto out; 4983 goto out;
4971 } 4984 }
4972 } 4985 }
4986
4987out_server_scope:
4973 kfree(res.server_scope); 4988 kfree(res.server_scope);
4974out: 4989out:
4990 if (clp->impl_id)
4991 dprintk("%s: Server Implementation ID: "
4992 "domain: %s, name: %s, date: %llu,%u\n",
4993 __func__, clp->impl_id->domain, clp->impl_id->name,
4994 clp->impl_id->date.seconds,
4995 clp->impl_id->date.nseconds);
4975 dprintk("<-- %s status= %d\n", __func__, status); 4996 dprintk("<-- %s status= %d\n", __func__, status);
4976 return status; 4997 return status;
4977} 4998}