Skip to content

Commit

Permalink
Fix regression in NFSRDMA server
Browse files Browse the repository at this point in the history
The server regression was caused by the addition of rq_next_page
(afc5940). 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>
  • Loading branch information
Tom Tucker authored and J. Bruce Fields committed Mar 28, 2014
1 parent fbb74a3 commit 7e4359e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
12 changes: 4 additions & 8 deletions net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static void rdma_build_arg_xdr(struct svc_rqst *rqstp,
sge_no++;
}
rqstp->rq_respages = &rqstp->rq_pages[sge_no];
rqstp->rq_next_page = rqstp->rq_respages + 1;

/* We should never run out of SGE because the limit is defined to
* support the max allowed RPC data length
Expand Down Expand Up @@ -169,6 +170,7 @@ static int map_read_chunks(struct svcxprt_rdma *xprt,
*/
head->arg.pages[page_no] = rqstp->rq_arg.pages[page_no];
rqstp->rq_respages = &rqstp->rq_arg.pages[page_no+1];
rqstp->rq_next_page = rqstp->rq_respages + 1;

byte_count -= sge_bytes;
ch_bytes -= sge_bytes;
Expand Down Expand Up @@ -276,6 +278,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,

/* rq_respages points one past arg pages */
rqstp->rq_respages = &rqstp->rq_arg.pages[page_no];
rqstp->rq_next_page = rqstp->rq_respages + 1;

/* Create the reply and chunk maps */
offset = 0;
Expand Down Expand Up @@ -520,13 +523,6 @@ static int rdma_read_xdr(struct svcxprt_rdma *xprt,
for (ch_no = 0; &rqstp->rq_pages[ch_no] < rqstp->rq_respages; ch_no++)
rqstp->rq_pages[ch_no] = NULL;

/*
* Detach res pages. If svc_release sees any it will attempt to
* put them.
*/
while (rqstp->rq_next_page != rqstp->rq_respages)
*(--rqstp->rq_next_page) = NULL;

return err;
}

Expand All @@ -550,7 +546,7 @@ static int rdma_read_complete(struct svc_rqst *rqstp,

/* rq_respages starts after the last arg page */
rqstp->rq_respages = &rqstp->rq_arg.pages[page_no];
rqstp->rq_next_page = &rqstp->rq_arg.pages[page_no];
rqstp->rq_next_page = rqstp->rq_respages + 1;

/* Rebuild rq_arg head and tail. */
rqstp->rq_arg.head[0] = head->arg.head[0];
Expand Down
1 change: 1 addition & 0 deletions net/sunrpc/xprtrdma/svc_rdma_sendto.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ static int send_reply(struct svcxprt_rdma *rdma,
if (page_no+1 >= sge_no)
ctxt->sge[page_no+1].length = 0;
}
rqstp->rq_next_page = rqstp->rq_respages + 1;
BUG_ON(sge_no > rdma->sc_max_sge);
memset(&send_wr, 0, sizeof send_wr);
ctxt->wr_op = IB_WR_SEND;
Expand Down

0 comments on commit 7e4359e

Please sign in to comment.