summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorJeff Layton2014-03-17 18:10:05 +0100
committerJ. Bruce Fields2014-03-28 23:02:13 +0100
commit3cbe01a94c7b369f943f8a9d40394198d757cdd4 (patch)
tree565877c84255ce7d04ae04523526365f884555d2 /net/sunrpc
parentxprtrdma: add separate Kconfig options for NFSoRDMA client and server support (diff)
downloadkernel-qcow2-linux-3cbe01a94c7b369f943f8a9d40394198d757cdd4.tar.gz
kernel-qcow2-linux-3cbe01a94c7b369f943f8a9d40394198d757cdd4.tar.xz
kernel-qcow2-linux-3cbe01a94c7b369f943f8a9d40394198d757cdd4.zip
svcrdma: fix offset calculation for non-page aligned sge entries
The xdr_off value in dma_map_xdr gets passed to ib_dma_map_page as the offset into the page to be mapped. This calculation does not correctly take into account the case where the data starts at some offset into the page. Increment the xdr_off by the page_base to ensure that it is respected. Cc: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 11e90f8c0fc5..7e024a51617e 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -265,6 +265,7 @@ static dma_addr_t dma_map_xdr(struct svcxprt_rdma *xprt,
xdr_off -= xdr->head[0].iov_len;
if (xdr_off < xdr->page_len) {
/* This offset is in the page list */
+ xdr_off += xdr->page_base;
page = xdr->pages[xdr_off >> PAGE_SHIFT];
xdr_off &= ~PAGE_MASK;
} else {