summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcsock.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2024-01-17 22:06:28 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-31 16:19:00 -0800
commit3f5aab7efd402b7494eeacb00f352f8f20b40d2d (patch)
tree242997f680753576f063a15d46f35bb199b9e70e /net/sunrpc/svcsock.c
parent14bafd198066480568967e5fa445ce3a7bbbad98 (diff)
downloadlinux-stable-3f5aab7efd402b7494eeacb00f352f8f20b40d2d.tar.gz
linux-stable-3f5aab7efd402b7494eeacb00f352f8f20b40d2d.tar.bz2
linux-stable-3f5aab7efd402b7494eeacb00f352f8f20b40d2d.zip
SUNRPC: use request size to initialize bio_vec in svc_udp_sendto()
[ Upstream commit 1d9cabe2817edd215779dc9c2fe5e7ab9aac0704 ] Use the proper size when setting up the bio_vec, as otherwise only zero-length UDP packets will be sent. Fixes: baabf59c2414 ("SUNRPC: Convert svc_udp_sendto() to use the per-socket bio_vec array") Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r--net/sunrpc/svcsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 998687421fa6..e0ce4276274b 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -717,12 +717,12 @@ static int svc_udp_sendto(struct svc_rqst *rqstp)
ARRAY_SIZE(rqstp->rq_bvec), xdr);
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,
- count, 0);
+ count, rqstp->rq_res.len);
err = sock_sendmsg(svsk->sk_sock, &msg);
if (err == -ECONNREFUSED) {
/* ICMP error on earlier request. */
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,
- count, 0);
+ count, rqstp->rq_res.len);
err = sock_sendmsg(svsk->sk_sock, &msg);
}