summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-26 13:41:04 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-05-26 14:17:31 -0400
commit32b0131069c5bebf52368a9fe170f8d58b78fa8d (patch)
tree540451b739e9938b2f15682a0bab117852bc8e4e /fs/nfs/nfs4xdr.c
parent662455391040a783b89d0232e743c27c23617dbd (diff)
NFSv4.1: Don't clobber the seqid if exchange_id returns a confirmed clientid
If the EXCHGID4_FLAG_CONFIRMED_R flag is set, the client is in theory supposed to already know the correct value of the seqid, in which case RFC5661 states that it should ignore the value returned. Also ensure that if the sanity check in nfs4_check_cl_exchange_flags fails, then we must not change the nfs_client fields. Finally, clean up the code: we don't need to retest the value of 'status' unless it can change. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c7
1 files changed, 3 insertions, 4 deletions
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);