diff options
-rw-r--r-- | fs/nfs/nfs42xdr.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 6dc6f2aea0d6..8b2605882a20 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c | |||
@@ -330,13 +330,21 @@ static int decode_write_response(struct xdr_stream *xdr, | |||
330 | struct nfs42_write_res *res) | 330 | struct nfs42_write_res *res) |
331 | { | 331 | { |
332 | __be32 *p; | 332 | __be32 *p; |
333 | int stateids; | ||
334 | 333 | ||
335 | p = xdr_inline_decode(xdr, 4 + 8 + 4); | 334 | p = xdr_inline_decode(xdr, 4 + 8 + 4); |
336 | if (unlikely(!p)) | 335 | if (unlikely(!p)) |
337 | goto out_overflow; | 336 | goto out_overflow; |
338 | 337 | ||
339 | stateids = be32_to_cpup(p++); | 338 | /* |
339 | * We never use asynchronous mode, so warn if a server returns | ||
340 | * a stateid. | ||
341 | */ | ||
342 | if (unlikely(*p != 0)) { | ||
343 | pr_err_once("%s: server has set unrequested " | ||
344 | "asynchronous mode\n", __func__); | ||
345 | return -EREMOTEIO; | ||
346 | } | ||
347 | p++; | ||
340 | p = xdr_decode_hyper(p, &res->count); | 348 | p = xdr_decode_hyper(p, &res->count); |
341 | res->verifier.committed = be32_to_cpup(p); | 349 | res->verifier.committed = be32_to_cpup(p); |
342 | return decode_verifier(xdr, &res->verifier.verifier); | 350 | return decode_verifier(xdr, &res->verifier.verifier); |