summary refs log tree commit diff
path: root/net/sunrpc/xprtrdma
diff options
context:
space:
mode:
authorDan Aloni <dan@kernelim.com>2020-10-02 22:33:43 +0300
committerJ. Bruce Fields <bfields@redhat.com>2020-10-16 15:15:04 -0400
commitc327a310ec4d6ecbea13185ed56c11def441d9ab (patch)
treecc6107511a88d2d02c9e9393040770cd87ad9079 /net/sunrpc/xprtrdma
parentc1488428a8daf5257a12dcec1739147e6aaf9557 (diff)
downloadlinux-c327a310ec4d6ecbea13185ed56c11def441d9ab.tar.gz
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: e248aa7be86 ("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>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 7b94d971feb3..c3d588b149aa 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -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++;
 		}
 	}