Blame SOURCES/0005-Correct-calculation-of-nr_nodes-and-re-enable-move_p.patch

2079c3
From d1bc1653b3f86b8951b876946a94db681764fa2a Mon Sep 17 00:00:00 2001
2079c3
From: Filipe Brandenburger <filbranden@google.com>
2079c3
Date: Fri, 15 Jun 2018 14:16:23 -0700
2079c3
Subject: [PATCH 5/7] Correct calculation of nr_nodes and re-enable move_pages
2079c3
 test
2079c3
2079c3
This was pointed out by @bjsprakash in #8.
2079c3
2079c3
After the bug is corrected, we can re-enable the test in `make check`,
2079c3
since most machines these days will have at least two nodes by default.
2079c3
2079c3
Travis-CI still fails with this test (one node only available), so keep
2079c3
skipping it there.
2079c3
2079c3
Signed-off-by: Pingfan Liu <piliu@redhat.com>
2079c3
---
2079c3
 Makefile.am       | 1 +
2079c3
 test/move_pages.c | 2 +-
2079c3
 2 files changed, 2 insertions(+), 1 deletion(-)
2079c3
2079c3
diff --git a/Makefile.am b/Makefile.am
2079c3
index 03b0ab6..1c4266d 100644
2079c3
--- a/Makefile.am
2079c3
+++ b/Makefile.am
2079c3
@@ -134,6 +134,7 @@ TESTS = \
2079c3
 	test/checkaffinity \
2079c3
 	test/checktopology \
2079c3
 	test/distance \
2079c3
+	test/move_pages \
2079c3
 	test/nodemap \
2079c3
 	test/numademo \
2079c3
 	test/regress \
2079c3
diff --git a/test/move_pages.c b/test/move_pages.c
2079c3
index 87d9b3e..c5010e2 100644
2079c3
--- a/test/move_pages.c
2079c3
+++ b/test/move_pages.c
2079c3
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
2079c3
 
2079c3
 	pagesize = getpagesize();
2079c3
 
2079c3
-	nr_nodes = numa_max_node();
2079c3
+	nr_nodes = numa_max_node() + 1;
2079c3
 
2079c3
 	if (nr_nodes < 2) {
2079c3
 		printf("A minimum of 2 nodes is required for this test.\n");
2079c3
-- 
2079c3
2.7.4
2079c3