summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs42xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs42xdr.c')
-rw-r--r--fs/nfs/nfs42xdr.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c
index 09a540d035b8..205c3567ea08 100644
--- a/fs/nfs/nfs42xdr.c
+++ b/fs/nfs/nfs42xdr.c
@@ -389,21 +389,23 @@ static int decode_write_response(struct xdr_stream *xdr,
389 struct nfs42_write_res *res) 389 struct nfs42_write_res *res)
390{ 390{
391 __be32 *p; 391 __be32 *p;
392 int status, count;
392 393
393 p = xdr_inline_decode(xdr, 4 + 8 + 4); 394 p = xdr_inline_decode(xdr, 4);
394 if (unlikely(!p)) 395 if (unlikely(!p))
395 goto out_overflow; 396 goto out_overflow;
396 397 count = be32_to_cpup(p);
397 /* 398 if (count > 1)
398 * We never use asynchronous mode, so warn if a server returns
399 * a stateid.
400 */
401 if (unlikely(*p != 0)) {
402 pr_err_once("%s: server has set unrequested "
403 "asynchronous mode\n", __func__);
404 return -EREMOTEIO; 399 return -EREMOTEIO;
400 else if (count == 1) {
401 status = decode_opaque_fixed(xdr, &res->stateid,
402 NFS4_STATEID_SIZE);
403 if (unlikely(status))
404 goto out_overflow;
405 } 405 }
406 p++; 406 p = xdr_inline_decode(xdr, 8 + 4);
407 if (unlikely(!p))
408 goto out_overflow;
407 p = xdr_decode_hyper(p, &res->count); 409 p = xdr_decode_hyper(p, &res->count);
408 res->verifier.committed = be32_to_cpup(p); 410 res->verifier.committed = be32_to_cpup(p);
409 return decode_verifier(xdr, &res->verifier.verifier); 411 return decode_verifier(xdr, &res->verifier.verifier);