Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v2] sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg
@ 2023-08-14 17:36 Jeff Layton
  2023-08-14 18:59 ` Chuck Lever
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2023-08-14 17:36 UTC (permalink / raw)
  To: Chuck Lever
  Cc: David Howells, Trond Myklebust, Anna Schumaker, Neil Brown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-nfs, netdev,
	linux-kernel, Jeff Layton

svc_tcp_sendmsg used to factor in the xdr->page_base when sending pages,
but 5df5dd03a8f7 dropped that part of the handling. Fix it by setting
the bv_offset of the first bvec.

Fixes: 5df5dd03a8f7 ("sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v2:
- limit the change to just svc_tcp_sendmsg
---
 net/sunrpc/svcsock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index e43f26382411..2eb8df44f894 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1244,6 +1244,9 @@ static int svc_tcp_sendmsg(struct socket *sock, struct xdr_buf *xdr,
 	if (ret != head->iov_len)
 		goto out;
 
+	if (xdr_buf_pagecount(xdr))
+		xdr->bvec[0].bv_offset = offset_in_page(xdr->page_base);
+
 	msg.msg_flags = MSG_SPLICE_PAGES;
 	iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, xdr->bvec,
 		      xdr_buf_pagecount(xdr), xdr->page_len);

---
base-commit: 2ccdd1b13c591d306f0401d98dedc4bdcd02b421
change-id: 20230814-sendpage-b04874eed249

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-14 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 17:36 [PATCH v2] sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg Jeff Layton
2023-08-14 18:59 ` Chuck Lever
2023-08-14 19:11   ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox