Skip to content

Commit

Permalink
svcrdma: fix bounce buffers for unaligned offsets and multiple pages
Browse files Browse the repository at this point in the history
[ Upstream commit c327a31 ]

This was discovered using O_DIRECT at the client side, with small
unaligned file offsets or IOs that span multiple file pages.

Fixes: e248aa7 ("svcrdma: Remove max_sge check at connect time")
Signed-off-by: Dan Aloni <dan@kernelim.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
da-x authored and gregkh committed Oct 29, 2020
1 parent a8ba752 commit b928b19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sunrpc/xprtrdma/svc_rdma_sendto.c
Expand Up @@ -638,10 +638,11 @@ static int svc_rdma_pull_up_reply_msg(struct svcxprt_rdma *rdma,
while (remaining) {
len = min_t(u32, PAGE_SIZE - pageoff, remaining);

memcpy(dst, page_address(*ppages), len);
memcpy(dst, page_address(*ppages) + pageoff, len);
remaining -= len;
dst += len;
pageoff = 0;
ppages++;
}
}

Expand Down

0 comments on commit b928b19

Please sign in to comment.