diff options
| author | Linus Walleij <[email protected]> | 2015-12-21 08:36:21 +0000 |
|---|---|---|
| committer | Linus Walleij <[email protected]> | 2015-12-21 08:36:21 +0000 |
| commit | 0529357f102b96f68bc199f858d1c3b07f4b674c (patch) | |
| tree | eaa047952a768099e00a5245afa0d84799df6990 /net/sunrpc/svc.c | |
| parent | gpio: pch: fix non-DT build (diff) | |
| parent | Linux 4.4-rc6 (diff) | |
| download | kernel-0529357f102b96f68bc199f858d1c3b07f4b674c.tar.gz kernel-0529357f102b96f68bc199f858d1c3b07f4b674c.zip | |
Merge tag 'v4.4-rc6' into devel
Linux 4.4-rc6
Diffstat (limited to 'net/sunrpc/svc.c')
| -rw-r--r-- | net/sunrpc/svc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index bc5b7b5032ca..cc9852897395 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1364,6 +1364,19 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req, memcpy(&rqstp->rq_arg, &req->rq_rcv_buf, sizeof(rqstp->rq_arg)); memcpy(&rqstp->rq_res, &req->rq_snd_buf, sizeof(rqstp->rq_res)); + /* Adjust the argument buffer length */ + rqstp->rq_arg.len = req->rq_private_buf.len; + if (rqstp->rq_arg.len <= rqstp->rq_arg.head[0].iov_len) { + rqstp->rq_arg.head[0].iov_len = rqstp->rq_arg.len; + rqstp->rq_arg.page_len = 0; + } else if (rqstp->rq_arg.len <= rqstp->rq_arg.head[0].iov_len + + rqstp->rq_arg.page_len) + rqstp->rq_arg.page_len = rqstp->rq_arg.len - + rqstp->rq_arg.head[0].iov_len; + else + rqstp->rq_arg.len = rqstp->rq_arg.head[0].iov_len + + rqstp->rq_arg.page_len; + /* reset result send buffer "put" position */ resv->iov_len = 0; |
