mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
SUNRPC: Fix the recent bv_offset fix
[ Upstream commitf16ff1cafb
] Jeff confirmed his original fix addressed his pynfs test failure, but this same bug also impacted qemu: accessing qcow2 virtual disks using direct I/O was failing. Jeff's fix missed that you have to shorten the bio_vec element by the same amount as you increased the page offset. Reported-by: Maxim Levitsky <mlevitsk@redhat.com> Fixes:c96e2a695e
("sunrpc: set the bv_offset of first bvec in svc_tcp_sendmsg") Tested-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f7121a903a
commit
3bf8d3ca5a
1 changed files with 3 additions and 1 deletions
|
@ -1244,8 +1244,10 @@ static int svc_tcp_sendmsg(struct socket *sock, struct xdr_buf *xdr,
|
|||
if (ret != head->iov_len)
|
||||
goto out;
|
||||
|
||||
if (xdr_buf_pagecount(xdr))
|
||||
if (xdr_buf_pagecount(xdr)) {
|
||||
xdr->bvec[0].bv_offset = offset_in_page(xdr->page_base);
|
||||
xdr->bvec[0].bv_len -= offset_in_page(xdr->page_base);
|
||||
}
|
||||
|
||||
msg.msg_flags = MSG_SPLICE_PAGES;
|
||||
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, xdr->bvec,
|
||||
|
|
Loading…
Reference in a new issue