diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index c3aebc1bf0a6..a67dd1a081dd 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -365,6 +365,7 @@ static int rdma_read_chunks(struct svcxprt_rdma *xprt, | |||
365 | int page_no, ret; | 365 | int page_no, ret; |
366 | struct rpcrdma_read_chunk *ch; | 366 | struct rpcrdma_read_chunk *ch; |
367 | u32 handle, page_offset, byte_count; | 367 | u32 handle, page_offset, byte_count; |
368 | u32 position; | ||
368 | u64 rs_offset; | 369 | u64 rs_offset; |
369 | bool last; | 370 | bool last; |
370 | 371 | ||
@@ -389,10 +390,17 @@ static int rdma_read_chunks(struct svcxprt_rdma *xprt, | |||
389 | head->arg.len = rqstp->rq_arg.len; | 390 | head->arg.len = rqstp->rq_arg.len; |
390 | head->arg.buflen = rqstp->rq_arg.buflen; | 391 | head->arg.buflen = rqstp->rq_arg.buflen; |
391 | 392 | ||
392 | page_no = 0; page_offset = 0; | 393 | ch = (struct rpcrdma_read_chunk *)&rmsgp->rm_body.rm_chunks[0]; |
393 | for (ch = (struct rpcrdma_read_chunk *)&rmsgp->rm_body.rm_chunks[0]; | 394 | position = be32_to_cpu(ch->rc_position); |
394 | ch->rc_discrim != 0; ch++) { | 395 | |
395 | handle = be32_to_cpu(ch->rc_target.rs_handle); | 396 | ret = 0; |
397 | page_no = 0; | ||
398 | page_offset = 0; | ||
399 | for (; ch->rc_discrim != xdr_zero; ch++) { | ||
400 | if (be32_to_cpu(ch->rc_position) != position) | ||
401 | goto err; | ||
402 | |||
403 | handle = be32_to_cpu(ch->rc_target.rs_handle), | ||
396 | byte_count = be32_to_cpu(ch->rc_target.rs_length); | 404 | byte_count = be32_to_cpu(ch->rc_target.rs_length); |
397 | xdr_decode_hyper((__be32 *)&ch->rc_target.rs_offset, | 405 | xdr_decode_hyper((__be32 *)&ch->rc_target.rs_offset, |
398 | &rs_offset); | 406 | &rs_offset); |