Commit c327a310 authored by Dan Aloni's avatar Dan Aloni Committed by J. Bruce Fields

svcrdma: fix bounce buffers for unaligned offsets and multiple pages

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

Fixes: e248aa7b ("svcrdma: Remove max_sge check at connect time")
Signed-off-by: default avatarDan Aloni <dan@kernelim.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent c1488428
...@@ -638,10 +638,11 @@ static int svc_rdma_pull_up_reply_msg(struct svcxprt_rdma *rdma, ...@@ -638,10 +638,11 @@ static int svc_rdma_pull_up_reply_msg(struct svcxprt_rdma *rdma,
while (remaining) { while (remaining) {
len = min_t(u32, PAGE_SIZE - pageoff, remaining); len = min_t(u32, PAGE_SIZE - pageoff, remaining);
memcpy(dst, page_address(*ppages), len); memcpy(dst, page_address(*ppages) + pageoff, len);
remaining -= len; remaining -= len;
dst += len; dst += len;
pageoff = 0; pageoff = 0;
ppages++;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment