aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs4proc.c17
-rw-r--r--fs/nfs/nfs4xdr.c7
-rw-r--r--include/linux/nfs_xdr.h3
3 files changed, 14 insertions, 13 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 485a6c0cdc40..9f0a96fe6212 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5171,7 +5171,7 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
5171 .flags = EXCHGID4_FLAG_SUPP_MOVED_REFER, 5171 .flags = EXCHGID4_FLAG_SUPP_MOVED_REFER,
5172 }; 5172 };
5173 struct nfs41_exchange_id_res res = { 5173 struct nfs41_exchange_id_res res = {
5174 .client = clp, 5174 0
5175 }; 5175 };
5176 int status; 5176 int status;
5177 struct rpc_message msg = { 5177 struct rpc_message msg = {
@@ -5214,22 +5214,22 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
5214 5214
5215 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT); 5215 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
5216 if (status == 0) 5216 if (status == 0)
5217 status = nfs4_check_cl_exchange_flags(clp->cl_exchange_flags); 5217 status = nfs4_check_cl_exchange_flags(res.flags);
5218 5218
5219 if (status == 0) { 5219 if (status == 0) {
5220 clp->cl_clientid = res.clientid;
5221 clp->cl_exchange_flags = (res.flags & ~EXCHGID4_FLAG_CONFIRMED_R);
5222 if (!(res.flags & EXCHGID4_FLAG_CONFIRMED_R))
5223 clp->cl_seqid = res.seqid;
5224
5220 kfree(clp->cl_serverowner); 5225 kfree(clp->cl_serverowner);
5221 clp->cl_serverowner = res.server_owner; 5226 clp->cl_serverowner = res.server_owner;
5222 res.server_owner = NULL; 5227 res.server_owner = NULL;
5223 }
5224 5228
5225 if (status == 0) {
5226 /* use the most recent implementation id */ 5229 /* use the most recent implementation id */
5227 kfree(clp->cl_implid); 5230 kfree(clp->cl_implid);
5228 clp->cl_implid = res.impl_id; 5231 clp->cl_implid = res.impl_id;
5229 } else
5230 kfree(res.impl_id);
5231 5232
5232 if (status == 0) {
5233 if (clp->cl_serverscope != NULL && 5233 if (clp->cl_serverscope != NULL &&
5234 !nfs41_same_server_scope(clp->cl_serverscope, 5234 !nfs41_same_server_scope(clp->cl_serverscope,
5235 res.server_scope)) { 5235 res.server_scope)) {
@@ -5244,7 +5244,8 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
5244 clp->cl_serverscope = res.server_scope; 5244 clp->cl_serverscope = res.server_scope;
5245 goto out; 5245 goto out;
5246 } 5246 }
5247 } 5247 } else
5248 kfree(res.impl_id);
5248 5249
5249out_server_owner: 5250out_server_owner:
5250 kfree(res.server_owner); 5251 kfree(res.server_owner);
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index b9ce3fdb862a..ee4a74db95d0 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -5319,7 +5319,6 @@ static int decode_exchange_id(struct xdr_stream *xdr,
5319 uint32_t dummy; 5319 uint32_t dummy;
5320 char *dummy_str; 5320 char *dummy_str;
5321 int status; 5321 int status;
5322 struct nfs_client *clp = res->client;
5323 uint32_t impl_id_count; 5322 uint32_t impl_id_count;
5324 5323
5325 status = decode_op_hdr(xdr, OP_EXCHANGE_ID); 5324 status = decode_op_hdr(xdr, OP_EXCHANGE_ID);
@@ -5329,12 +5328,12 @@ static int decode_exchange_id(struct xdr_stream *xdr,
5329 p = xdr_inline_decode(xdr, 8); 5328 p = xdr_inline_decode(xdr, 8);
5330 if (unlikely(!p)) 5329 if (unlikely(!p))
5331 goto out_overflow; 5330 goto out_overflow;
5332 xdr_decode_hyper(p, &clp->cl_clientid); 5331 xdr_decode_hyper(p, &res->clientid);
5333 p = xdr_inline_decode(xdr, 12); 5332 p = xdr_inline_decode(xdr, 12);
5334 if (unlikely(!p)) 5333 if (unlikely(!p))
5335 goto out_overflow; 5334 goto out_overflow;
5336 clp->cl_seqid = be32_to_cpup(p++); 5335 res->seqid = be32_to_cpup(p++);
5337 clp->cl_exchange_flags = be32_to_cpup(p++); 5336 res->flags = be32_to_cpup(p++);
5338 5337
5339 /* We ask for SP4_NONE */ 5338 /* We ask for SP4_NONE */
5340 dummy = be32_to_cpup(p); 5339 dummy = be32_to_cpup(p);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 6387fc0097fe..d1a7bf51c326 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1132,7 +1132,8 @@ struct nfs41_bind_conn_to_session_res {
1132}; 1132};
1133 1133
1134struct nfs41_exchange_id_res { 1134struct nfs41_exchange_id_res {
1135 struct nfs_client *client; 1135 u64 clientid;
1136 u32 seqid;
1136 u32 flags; 1137 u32 flags;
1137 struct nfs41_server_owner *server_owner; 1138 struct nfs41_server_owner *server_owner;
1138 struct nfs41_server_scope *server_scope; 1139 struct nfs41_server_scope *server_scope;