linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] svcrdma: fix offset calculation for non-page aligned sge entries
@ 2014-03-17 17:10 Jeff Layton
  2014-03-28 21:52 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2014-03-17 17:10 UTC (permalink / raw)
  To: bfields; +Cc: tom, linux-nfs

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>
---
 net/sunrpc/xprtrdma/svc_rdma_sendto.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index c1d124dc772b..5f14609b6336 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 {
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] svcrdma: fix offset calculation for non-page aligned sge entries
  2014-03-17 17:10 [PATCH v2] svcrdma: fix offset calculation for non-page aligned sge entries Jeff Layton
@ 2014-03-28 21:52 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2014-03-28 21:52 UTC (permalink / raw)
  To: Jeff Layton; +Cc: tom, linux-nfs

On Mon, Mar 17, 2014 at 01:10:05PM -0400, Jeff Layton wrote:
> 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.

Thanks, applying.--b.

> 
> Cc: Tom Tucker <tom@opengridcomputing.com>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  net/sunrpc/xprtrdma/svc_rdma_sendto.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
> index c1d124dc772b..5f14609b6336 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 {
> -- 
> 1.8.5.3
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-28 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-17 17:10 [PATCH v2] svcrdma: fix offset calculation for non-page aligned sge entries Jeff Layton
2014-03-28 21:52 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).