linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.30] svcrdma: Fix dma map direction for rdma read targets
@ 2009-04-03 20:18 Steve Wise
       [not found] ` <20090403201824.18102.62915.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Wise @ 2009-04-03 20:18 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, tom

The nfs server rdma transport was mapping rdma read target pages for
TO_DEVICE instead of FROM_DEVICE.  This causes data corruption on non
cache-coherent systems if frmrs are used.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index 629a287..42a6f9f 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
 		frmr->page_list->page_list[page_no] =
 			ib_dma_map_single(xprt->sc_cm_id->device,
 					  page_address(rqstp->rq_arg.pages[page_no]),
-					  PAGE_SIZE, DMA_TO_DEVICE);
+					  PAGE_SIZE, DMA_FROM_DEVICE);
 		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
 					 frmr->page_list->page_list[page_no]))
 			goto fatal_err;


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

* Re: [PATCH 2.6.30] svcrdma: Fix dma map direction for rdma read targets
       [not found] ` <20090403201824.18102.62915.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
@ 2009-04-03 20:23   ` Tom Tucker
  2009-04-09 15:32     ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tucker @ 2009-04-03 20:23 UTC (permalink / raw)
  To: Steve Wise; +Cc: bfields, linux-nfs

Steve Wise wrote:
> The nfs server rdma transport was mapping rdma read target pages for
> TO_DEVICE instead of FROM_DEVICE.  This causes data corruption on non
> cache-coherent systems if frmrs are used.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
> ---
> 
>  net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
> index 629a287..42a6f9f 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
> @@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
>  		frmr->page_list->page_list[page_no] =
>  			ib_dma_map_single(xprt->sc_cm_id->device,
>  					  page_address(rqstp->rq_arg.pages[page_no]),
> -					  PAGE_SIZE, DMA_TO_DEVICE);
> +					  PAGE_SIZE, DMA_FROM_DEVICE);

FWIW, this looks good to me.

>  		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
>  					 frmr->page_list->page_list[page_no]))
>  			goto fatal_err;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH 2.6.30] svcrdma: Fix dma map direction for rdma read targets
  2009-04-03 20:23   ` Tom Tucker
@ 2009-04-09 15:32     ` J. Bruce Fields
  2009-04-09 19:17       ` Tom Tucker
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2009-04-09 15:32 UTC (permalink / raw)
  To: Tom Tucker; +Cc: Steve Wise, linux-nfs

On Fri, Apr 03, 2009 at 03:23:47PM -0500, Tom Tucker wrote:
> Steve Wise wrote:
>> The nfs server rdma transport was mapping rdma read target pages for
>> TO_DEVICE instead of FROM_DEVICE.  This causes data corruption on non
>> cache-coherent systems if frmrs are used.
>>
>> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
>> ---
>>
>>  net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
>> index 629a287..42a6f9f 100644
>> --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
>> +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
>> @@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
>>  		frmr->page_list->page_list[page_no] =
>>  			ib_dma_map_single(xprt->sc_cm_id->device,
>>  					  page_address(rqstp->rq_arg.pages[page_no]),
>> -					  PAGE_SIZE, DMA_TO_DEVICE);
>> +					  PAGE_SIZE, DMA_FROM_DEVICE);
>
> FWIW, this looks good to me.

Thanks; I'll add an acked-by if you don't object.  Should this go to
stable as well?

--b.

>
>>  		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
>>  					 frmr->page_list->page_list[page_no]))
>>  			goto fatal_err;
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: [PATCH 2.6.30] svcrdma: Fix dma map direction for rdma read targets
  2009-04-09 15:32     ` J. Bruce Fields
@ 2009-04-09 19:17       ` Tom Tucker
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tucker @ 2009-04-09 19:17 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Steve Wise, linux-nfs

J. Bruce Fields wrote:
> On Fri, Apr 03, 2009 at 03:23:47PM -0500, Tom Tucker wrote:
>> Steve Wise wrote:
>>> The nfs server rdma transport was mapping rdma read target pages for
>>> TO_DEVICE instead of FROM_DEVICE.  This causes data corruption on non
>>> cache-coherent systems if frmrs are used.
>>>
>>> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
>>> ---
>>>
>>>  net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
>>> index 629a287..42a6f9f 100644
>>> --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
>>> +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
>>> @@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
>>>  		frmr->page_list->page_list[page_no] =
>>>  			ib_dma_map_single(xprt->sc_cm_id->device,
>>>  					  page_address(rqstp->rq_arg.pages[page_no]),
>>> -					  PAGE_SIZE, DMA_TO_DEVICE);
>>> +					  PAGE_SIZE, DMA_FROM_DEVICE);
>> FWIW, this looks good to me.
> 
> Thanks; I'll add an acked-by if you don't object. 

Sure...

>... Should this go to
> stable as well?
> 

I think so because it's a bug and we've verified it fixes the data 
corruption issue and doesn't regress existing platforms.


> --b.
> 
>>>  		if (ib_dma_mapping_error(xprt->sc_cm_id->device,
>>>  					 frmr->page_list->page_list[page_no]))
>>>  			goto fatal_err;
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2009-04-09 19:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-03 20:18 [PATCH 2.6.30] svcrdma: Fix dma map direction for rdma read targets Steve Wise
     [not found] ` <20090403201824.18102.62915.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2009-04-03 20:23   ` Tom Tucker
2009-04-09 15:32     ` J. Bruce Fields
2009-04-09 19:17       ` Tom Tucker

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).