]> git.karo-electronics.de Git - linux-beck.git/commitdiff
svcrdma: Fix dma map direction for rdma read targets
authorSteve Wise <swise@opengridcomputing.com>
Fri, 3 Apr 2009 20:18:24 +0000 (15:18 -0500)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Sat, 25 Apr 2009 22:11:14 +0000 (18:11 -0400)
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>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c

index 629a28764da9362c773050a5bcde27ecb19d0ed2..42a6f9f2028567bc91b3860bc8204b656f7e7664 100644 (file)
@@ -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;