[PATCH] fixup! userfaultfd/selftests: reinitialize test context in each test
From: Peter Xu
Date: Tue May 18 2021 - 16:50:36 EST
Signed-off-by: Peter Xu <peterx@xxxxxxxxxx>
---
tools/testing/selftests/vm/userfaultfd.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index c4150b4fbd17..f78816130c7f 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -1326,7 +1326,7 @@ static void userfaultfd_pagemap_test(unsigned int test_pgsize)
/* Flush so it doesn't flush twice in parent/child later */
fflush(stdout);
- uffd_test_ops->release_pages(area_dst);
+ uffd_test_ctx_init(0);
if (test_pgsize > page_size) {
/* This is a thp test */
@@ -1338,9 +1338,6 @@ static void userfaultfd_pagemap_test(unsigned int test_pgsize)
err("madvise(MADV_NOHUGEPAGE) failed");
}
- if (userfaultfd_open(0))
- err("userfaultfd_open");
-
uffdio_register.range.start = (unsigned long) area_dst;
uffdio_register.range.len = nr_pages * page_size;
uffdio_register.mode = UFFDIO_REGISTER_MODE_WP;
@@ -1383,7 +1380,6 @@ static void userfaultfd_pagemap_test(unsigned int test_pgsize)
pagemap_check_wp(value, false);
close(pagemap_fd);
- close(uffd);
printf("done\n");
}
--
2.31.1
--D6+R1HeMtL7GYPqG--