diff options
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/vm/userfaultfd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index 10897092823d..174f2fc8d257 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c | |||
@@ -422,7 +422,7 @@ static int userfaultfd_stress(void) | |||
422 | struct uffdio_register uffdio_register; | 422 | struct uffdio_register uffdio_register; |
423 | struct uffdio_api uffdio_api; | 423 | struct uffdio_api uffdio_api; |
424 | unsigned long cpu; | 424 | unsigned long cpu; |
425 | int uffd_flags; | 425 | int uffd_flags, err; |
426 | unsigned long userfaults[nr_cpus]; | 426 | unsigned long userfaults[nr_cpus]; |
427 | 427 | ||
428 | if (posix_memalign(&area, page_size, nr_pages * page_size)) { | 428 | if (posix_memalign(&area, page_size, nr_pages * page_size)) { |
@@ -499,6 +499,7 @@ static int userfaultfd_stress(void) | |||
499 | pthread_attr_init(&attr); | 499 | pthread_attr_init(&attr); |
500 | pthread_attr_setstacksize(&attr, 16*1024*1024); | 500 | pthread_attr_setstacksize(&attr, 16*1024*1024); |
501 | 501 | ||
502 | err = 0; | ||
502 | while (bounces--) { | 503 | while (bounces--) { |
503 | unsigned long expected_ioctls; | 504 | unsigned long expected_ioctls; |
504 | 505 | ||
@@ -583,8 +584,9 @@ static int userfaultfd_stress(void) | |||
583 | area_dst + nr * page_size, | 584 | area_dst + nr * page_size, |
584 | sizeof(pthread_mutex_t))) { | 585 | sizeof(pthread_mutex_t))) { |
585 | fprintf(stderr, | 586 | fprintf(stderr, |
586 | "error mutex 2 %lu\n", | 587 | "error mutex %lu\n", |
587 | nr); | 588 | nr); |
589 | err = 1; | ||
588 | bounces = 0; | 590 | bounces = 0; |
589 | } | 591 | } |
590 | if (*area_count(area_dst, nr) != count_verify[nr]) { | 592 | if (*area_count(area_dst, nr) != count_verify[nr]) { |
@@ -593,6 +595,7 @@ static int userfaultfd_stress(void) | |||
593 | *area_count(area_src, nr), | 595 | *area_count(area_src, nr), |
594 | count_verify[nr], | 596 | count_verify[nr], |
595 | nr); | 597 | nr); |
598 | err = 1; | ||
596 | bounces = 0; | 599 | bounces = 0; |
597 | } | 600 | } |
598 | } | 601 | } |
@@ -609,7 +612,7 @@ static int userfaultfd_stress(void) | |||
609 | printf("\n"); | 612 | printf("\n"); |
610 | } | 613 | } |
611 | 614 | ||
612 | return 0; | 615 | return err; |
613 | } | 616 | } |
614 | 617 | ||
615 | int main(int argc, char **argv) | 618 | int main(int argc, char **argv) |