SUNRPC: avoid zero-length UDP packets

Cherry-picks commit 1d9cabe2817e ("SUNRPC: use request size to
initialize bio_vec in svc_udp_sendto()") from linux-yocto in order
to use the proper size when setting up the bio_vec, as otherwise
only zero-length UDP packets will be sent.

* commit d9cabe2817e ("SUNRPC: use request size to initialize
  bio_vec in svc_udp_sendto()")
  https://git.yoctoproject.org/linux-yocto/commit/?id=1d9cabe2817e

Test Plan:
PASS: Succesful NFS mount during C-1 install of an AIO-DX

Closes-bug: 2069643

Change-Id: Iac09d24ff5f3cc4c64690e1c42356d7f57f95d66
Signed-off-by: Matheus Guilhermino <Matheus.MachadoGuilhermino@windriver.com>
(cherry picked from commit 3c6402b23c)
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
This commit is contained in:
Matheus Guilhermino
2024-06-17 16:32:12 -03:00
committed by Jiping Ma
parent 74e2b36fa9
commit c751442240
4 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
From 7054d0bcc43c621cd514b3bb488ff697d3aee74a Mon Sep 17 00:00:00 2001
From: Lucas Stach <l.stach@pengutronix.de>
Date: Wed, 17 Jan 2024 22:06:28 +0100
Subject: [PATCH] SUNRPC: use request size to initialize bio_vec in
svc_udp_sendto()
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>
(cherry picked from commit 1d9cabe2817edd215779dc9c2fe5e7ab9aac0704)
Signed-off-by: Matheus Guilhermino <Matheus.MachadoGuilhermino@windriver.com>
---
net/sunrpc/svcsock.c | 4 ++--
1 file 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);
}
--
2.34.1

View File

@@ -15,3 +15,4 @@
0015-Add-the-pci-reboot-quirk-in-DMI-table-for-Dell-Power.patch
0016-Add-driver-versions-for-ice-i40e-and-iavf.patch
0017-ice-Use-irq_update_affinity_hint.patch
0018-SUNRPC-use-request-size-to-initialize-bio_vec-in-svc.patch

View File

@@ -0,0 +1,40 @@
From 2f86ea6f73a0793308fc54fa4f89aaa07f30e0ff Mon Sep 17 00:00:00 2001
From: Lucas Stach <l.stach@pengutronix.de>
Date: Wed, 17 Jan 2024 22:06:28 +0100
Subject: [PATCH] SUNRPC: use request size to initialize bio_vec in
svc_udp_sendto()
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>
(cherry picked from commit 1d9cabe2817edd215779dc9c2fe5e7ab9aac0704)
Signed-off-by: Matheus Guilhermino <Matheus.MachadoGuilhermino@windriver.com>
---
net/sunrpc/svcsock.c | 4 ++--
1 file 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);
}
--
2.34.1

View File

@@ -15,3 +15,4 @@
0015-Add-the-pci-reboot-quirk-in-DMI-table-for-Dell-Power.patch
0016-Add-driver-versions-for-ice-i40e-and-iavf.patch
0017-ice-Use-irq_update_affinity_hint.patch
0018-SUNRPC-use-request-size-to-initialize-bio_vec-in-svc.patch