Skip to content

Commit c96e2a6

Browse files
jtlaytonchucklever
authored andcommitted
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 5df5dd0 ("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: 5df5dd0 ("sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage") Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 2ccdd1b commit c96e2a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/sunrpc/svcsock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,9 @@ static int svc_tcp_sendmsg(struct socket *sock, struct xdr_buf *xdr,
12441244
if (ret != head->iov_len)
12451245
goto out;
12461246

1247+
if (xdr_buf_pagecount(xdr))
1248+
xdr->bvec[0].bv_offset = offset_in_page(xdr->page_base);
1249+
12471250
msg.msg_flags = MSG_SPLICE_PAGES;
12481251
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, xdr->bvec,
12491252
xdr_buf_pagecount(xdr), xdr->page_len);

0 commit comments

Comments
 (0)