summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-17 21:22:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 09:10:55 +0200
commit3afd8b1e1568a9357ad268fed8d340552c35a81f (patch)
tree340c4b73eb2cffd5d353cc83cfdafa4491f6744c /net/sunrpc/clnt.c
parenta09d3e3c3092a97d936a8e90e8f247fafcc7b951 (diff)
downloadlinux-stable-3afd8b1e1568a9357ad268fed8d340552c35a81f.tar.gz
linux-stable-3afd8b1e1568a9357ad268fed8d340552c35a81f.tar.bz2
linux-stable-3afd8b1e1568a9357ad268fed8d340552c35a81f.zip
SUNRPC: Ensure the bvecs are reset when we re-encode the RPC request
commit 75369089820473eac45e9ddd970081901a373c08 upstream. The bvec tracks the list of pages, so if the number of pages changes due to a re-encode, we need to reset the bvec as well. Fixes: 277e4ab7d530 ("SUNRPC: Simplify TCP receive code by switching...") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: stable@vger.kernel.org # v4.20+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index b03bfa055c08..9e1743b364ec 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1788,6 +1788,7 @@ rpc_xdr_encode(struct rpc_task *task)
req->rq_snd_buf.head[0].iov_len = 0;
xdr_init_encode(&xdr, &req->rq_snd_buf,
req->rq_snd_buf.head[0].iov_base, req);
+ xdr_free_bvec(&req->rq_snd_buf);
if (rpc_encode_header(task, &xdr))
return;
@@ -1827,8 +1828,6 @@ call_encode(struct rpc_task *task)
rpc_call_rpcerror(task, task->tk_status);
}
return;
- } else {
- xprt_request_prepare(task->tk_rqstp);
}
/* Add task to reply queue before transmission to avoid races */