diff options
author | Tom Tucker <tom@ogc.us> | 2014-03-25 16:14:57 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-03-28 18:02:11 -0400 |
commit | 7e4359e2611f95a97037e2b6905eab52f28afbeb (patch) | |
tree | 62e23c487ebd0df94adf8cbfe8d771eb2d2301e4 /net | |
parent | fbb74a34a5b04dee0602e19f3f46496f8bf1d6b4 (diff) |
Fix regression in NFSRDMA server
The server regression was caused by the addition of rq_next_page
(afc59400d6c65bad66d4ad0b2daf879cbff8e23e). There were a few places that
were missed with the update of the rq_respages array.
Signed-off-by: Tom Tucker <tom@ogc.us>
Tested-by: Steve Wise <swise@ogc.us>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 12 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_sendto.c | 1 |
2 files changed, 5 insertions, 8 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index 0ce75524ed21..8d904e4eef15 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -90,6 +90,7 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp, | |||
90 | sge_no++; | 90 | sge_no++; |
91 | } | 91 | } |
92 | rqstp->rq_respages = &rqstp->rq_pages[sge_no]; | 92 | rqstp->rq_respages = &rqstp->rq_pages[sge_no]; |
93 | rqstp->rq_next_page = rqstp->rq_respages + 1; | ||
93 | 94 | ||
94 | /* We should never run out of SGE because the limit is defined to | 95 | /* We should never run out of SGE because the limit is defined to |
95 | * support the max allowed RPC data length | 96 | * support the max allowed RPC data length |
@@ -169,6 +170,7 @@ static int map_read_chunks(struct svcxprt_rdma *xprt, | |||
169 | */ | 170 | */ |
170 | head->arg.pages[page_no] = rqstp->rq_arg.pages[page_no]; | 171 | head->arg.pages[page_no] = rqstp->rq_arg.pages[page_no]; |
171 | rqstp->rq_respages = &rqstp->rq_arg.pages[page_no+1]; | 172 | rqstp->rq_respages = &rqstp->rq_arg.pages[page_no+1]; |
173 | rqstp->rq_next_page = rqstp->rq_respages + 1; | ||
172 | 174 | ||
173 | byte_count -= sge_bytes; | 175 | byte_count -= sge_bytes; |
174 | ch_bytes -= sge_bytes; | 176 | ch_bytes -= sge_bytes; |
@@ -276,6 +278,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt, | |||
276 | 278 | ||
277 | /* rq_respages points one past arg pages */ | 279 | /* rq_respages points one past arg pages */ |
278 | rqstp->rq_respages = &rqstp->rq_arg.pages[page_no]; | 280 | rqstp->rq_respages = &rqstp->rq_arg.pages[page_no]; |
281 | rqstp->rq_next_page = rqstp->rq_respages + 1; | ||
279 | 282 | ||
280 | /* Create the reply and chunk maps */ | 283 | /* Create the reply and chunk maps */ |
281 | offset = 0; | 284 | offset = 0; |
@@ -520,13 +523,6 @@ next_sge: | |||
520 | for (ch_no = 0; &rqstp->rq_pages[ch_no] < rqstp->rq_respages; ch_no++) | 523 | for (ch_no = 0; &rqstp->rq_pages[ch_no] < rqstp->rq_respages; ch_no++) |
521 | rqstp->rq_pages[ch_no] = NULL; | 524 | rqstp->rq_pages[ch_no] = NULL; |
522 | 525 | ||
523 | /* | ||
524 | * Detach res pages. If svc_release sees any it will attempt to | ||
525 | * put them. | ||
526 | */ | ||
527 | while (rqstp->rq_next_page != rqstp->rq_respages) | ||
528 | *(--rqstp->rq_next_page) = NULL; | ||
529 | |||
530 | return err; | 526 | return err; |
531 | } | 527 | } |
532 | 528 | ||
@@ -550,7 +546,7 @@ static int rdma_read_complete(struct svc_rqst *rqstp, | |||
550 | 546 | ||
551 | /* rq_respages starts after the last arg page */ | 547 | /* rq_respages starts after the last arg page */ |
552 | rqstp->rq_respages = &rqstp->rq_arg.pages[page_no]; | 548 | rqstp->rq_respages = &rqstp->rq_arg.pages[page_no]; |
553 | rqstp->rq_next_page = &rqstp->rq_arg.pages[page_no]; | 549 | rqstp->rq_next_page = rqstp->rq_respages + 1; |
554 | 550 | ||
555 | /* Rebuild rq_arg head and tail. */ | 551 | /* Rebuild rq_arg head and tail. */ |
556 | rqstp->rq_arg.head[0] = head->arg.head[0]; | 552 | rqstp->rq_arg.head[0] = head->arg.head[0]; |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index c1d124dc772b..11e90f8c0fc5 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c | |||
@@ -625,6 +625,7 @@ static int send_reply(struct svcxprt_rdma *rdma, | |||
625 | if (page_no+1 >= sge_no) | 625 | if (page_no+1 >= sge_no) |
626 | ctxt->sge[page_no+1].length = 0; | 626 | ctxt->sge[page_no+1].length = 0; |
627 | } | 627 | } |
628 | rqstp->rq_next_page = rqstp->rq_respages + 1; | ||
628 | BUG_ON(sge_no > rdma->sc_max_sge); | 629 | BUG_ON(sge_no > rdma->sc_max_sge); |
629 | memset(&send_wr, 0, sizeof send_wr); | 630 | memset(&send_wr, 0, sizeof send_wr); |
630 | ctxt->wr_op = IB_WR_SEND; | 631 | ctxt->wr_op = IB_WR_SEND; |