diff options
author | Mitko Haralanov <mitko.haralanov@intel.com> | 2016-03-08 22:15:16 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-21 22:55:23 +0300 |
commit | a489876010377481823ae5dbbd83fa32792a2e16 (patch) | |
tree | b8dc2412d2b9f8609304af3c821f725939b2f78d | |
parent | 0f310a00e02094ea7a2a7d2ae45bd51d97706caa (diff) | |
download | linux-a489876010377481823ae5dbbd83fa32792a2e16.tar.xz |
IB/hfi1: Adjust last address values for intervals
Last address values for intervals in the interval RB tree
nodes should be non-inclusive in order to avoid confusing
ranges.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/staging/rdma/hfi1/mmu_rb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/rdma/hfi1/mmu_rb.c b/drivers/staging/rdma/hfi1/mmu_rb.c index 6edd5f022057..c7ad0164ea9a 100644 --- a/drivers/staging/rdma/hfi1/mmu_rb.c +++ b/drivers/staging/rdma/hfi1/mmu_rb.c @@ -90,7 +90,7 @@ static unsigned long mmu_node_start(struct mmu_rb_node *node) static unsigned long mmu_node_last(struct mmu_rb_node *node) { - return ((node->addr & PAGE_MASK) + node->len); + return PAGE_ALIGN((node->addr & PAGE_MASK) + node->len) - 1; } int hfi1_mmu_rb_register(struct rb_root *root, struct mmu_rb_ops *ops) @@ -281,8 +281,8 @@ static void mmu_notifier_mem_invalidate(struct mmu_notifier *mn, unsigned long flags; spin_lock_irqsave(&handler->lock, flags); - for (node = __mmu_int_rb_iter_first(root, start, end); node; - node = __mmu_int_rb_iter_next(node, start, end)) { + for (node = __mmu_int_rb_iter_first(root, start, end - 1); node; + node = __mmu_int_rb_iter_next(node, start, end - 1)) { hfi1_cdbg(MMU, "Invalidating node addr 0x%llx, len %u", node->addr, node->len); if (handler->ops->invalidate(root, node)) |