summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2023-08-14 20:36:54 +0300
committerChuck Lever <chuck.lever@oracle.com>2023-08-14 22:02:25 +0300
commitc96e2a695e00bca5487824d84b85aab6aa2c1891 (patch)
tree95edc78c1a0fdfd77e6f52575149ef541371a58c /net
parent2ccdd1b13c591d306f0401d98dedc4bdcd02b421 (diff)
downloadlinux-c96e2a695e00bca5487824d84b85aab6aa2c1891.tar.xz
sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg
svc_tcp_sendmsg used to factor in the xdr->page_base when sending pages, but commit 5df5dd03a8f7 ("sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage") 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> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c3
1 files changed, 3 insertions, 0 deletions
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);