aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/user_sdma.c
diff options
context:
space:
mode:
authorMitko Haralanov <mitko.haralanov@intel.com>2016-04-12 10:46:41 -0700
committerDoug Ledford <dledford@redhat.com>2016-04-28 16:32:26 -0400
commitde79093b284888faedb826d8ecd326e5b6843d88 (patch)
treec7479cdee07218b4876f4990d76b4136a6b4ef57 /drivers/staging/rdma/hfi1/user_sdma.c
parentIB/hfi1: Protect the interval RB tree when cleaning up (diff)
downloadlinux-dev-de79093b284888faedb826d8ecd326e5b6843d88.tar.xz
linux-dev-de79093b284888faedb826d8ecd326e5b6843d88.zip
IB/hfi1: Correctly compute node interval
The computation of the interval of an interval RB node was incorrect leading to data corruption due to the RB search algorithm not properly finding the all RB nodes in an MMU invalidation interval. The problem stemmed from the fact that the beginning address of the node's range was being aligned to a page boundary. For certain buffer sizes, this would lead to a end address calculation that was off by 1 page. An important aspect of keeping the RB same is also updating the node's range in the case it's being extended. Reviewed-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/staging/rdma/hfi1/user_sdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c
index 044d33777fba..d1645d98a43d 100644
--- a/drivers/staging/rdma/hfi1/user_sdma.c
+++ b/drivers/staging/rdma/hfi1/user_sdma.c
@@ -1076,7 +1076,6 @@ static int pin_vector_pages(struct user_sdma_request *req,
return -ENOMEM;
node->rb.addr = (unsigned long)iovec->iov.iov_base;
- node->rb.len = iovec->iov.iov_len;
node->pq = pq;
atomic_set(&node->refcount, 0);
INIT_LIST_HEAD(&node->list);
@@ -1117,6 +1116,7 @@ retry:
goto bail;
}
kfree(node->pages);
+ node->rb.len = iovec->iov.iov_len;
node->pages = pages;
node->npages += pinned;
npages = node->npages;