diff options
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;  |