Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fbarray: fix overlap check
[ upstream commit 27ff838 ]

When we're attaching fbarrays in secondary processes, we check for
whether the intended memory address for the fbarray is already in use by
some other, local fbarray. However, the check for end-overlap (i.e. to
see if our memory area's end overlaps with some other fbarray) is
incorrectly counting end offset as part of the overlap. Fix the check.

Fixes: 5b61c62 ("fbarray: add internal tailq for mapped areas")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Zhihong Peng <zhihongx.peng@intel.com>
  • Loading branch information
anatolyburakov authored and bluca committed Feb 4, 2021
1 parent 3f39b91 commit 5a949c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/librte_eal/common/eal_common_fbarray.c
Expand Up @@ -110,7 +110,7 @@ overlap(const struct mem_area *ma, const void *start, size_t len)
if (start >= ma_start && start < ma_end)
return 1;
/* end overlap? */
if (end >= ma_start && end < ma_end)
if (end > ma_start && end < ma_end)
return 1;
return 0;
}
Expand Down

0 comments on commit 5a949c6

Please sign in to comment.