diff options
author | Olga Kornievskaia <kolga@netapp.com> | 2018-07-09 15:13:30 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-08-09 12:56:38 -0400 |
commit | 67aa7444c4beb40aafedd8d2c60bbcc54987adda (patch) | |
tree | e3306c3b336934f335295adb810141a9a5087b09 | |
parent | cb95deea0b4aa5c7c7423f4e075a3ddcd59e710b (diff) |
NFS COPY xdr handle async reply
If server returns async reply, it must include a callback stateid,
wr_callback_id in the write_response4.
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | fs/nfs/nfs42xdr.c | 22 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 1 |
2 files changed, 13 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); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 85e928a56cef..06ddfa31cbef 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -1391,6 +1391,7 @@ struct nfs42_copy_args { | |||
1391 | }; | 1391 | }; |
1392 | 1392 | ||
1393 | struct nfs42_write_res { | 1393 | struct nfs42_write_res { |
1394 | nfs4_stateid stateid; | ||
1394 | u64 count; | 1395 | u64 count; |
1395 | struct nfs_writeverf verifier; | 1396 | struct nfs_writeverf verifier; |
1396 | }; | 1397 | }; |