summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrea Arcangeli <aarcange@redhat.com>2015-09-22 14:59:03 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-22 15:09:53 -0700
commita5932bf5737f0b5caf6deaa92b062e4fe66cf5b2 (patch)
treeb856d98c07e0cae80166a9e6dbd14df5f9b2099d /tools
parent1f5fee2cf232f9fac05b65f21107d2cf3c32092c (diff)
downloadop-kernel-dev-a5932bf5737f0b5caf6deaa92b062e4fe66cf5b2.zip
op-kernel-dev-a5932bf5737f0b5caf6deaa92b062e4fe66cf5b2.tar.gz
userfaultfd: selftest: return an error if BOUNCE_VERIFY fails
This will report the error in the exit code, in addition of the fprintf. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Shuah Khan <shuahkh@osg.samsung.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/vm/userfaultfd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 1089709..174f2fc 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -422,7 +422,7 @@ static int userfaultfd_stress(void)
struct uffdio_register uffdio_register;
struct uffdio_api uffdio_api;
unsigned long cpu;
- int uffd_flags;
+ int uffd_flags, err;
unsigned long userfaults[nr_cpus];
if (posix_memalign(&area, page_size, nr_pages * page_size)) {
@@ -499,6 +499,7 @@ static int userfaultfd_stress(void)
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 16*1024*1024);
+ err = 0;
while (bounces--) {
unsigned long expected_ioctls;
@@ -583,8 +584,9 @@ static int userfaultfd_stress(void)
area_dst + nr * page_size,
sizeof(pthread_mutex_t))) {
fprintf(stderr,
- "error mutex 2 %lu\n",
+ "error mutex %lu\n",
nr);
+ err = 1;
bounces = 0;
}
if (*area_count(area_dst, nr) != count_verify[nr]) {
@@ -593,6 +595,7 @@ static int userfaultfd_stress(void)
*area_count(area_src, nr),
count_verify[nr],
nr);
+ err = 1;
bounces = 0;
}
}
@@ -609,7 +612,7 @@ static int userfaultfd_stress(void)
printf("\n");
}
- return 0;
+ return err;
}
int main(int argc, char **argv)
OpenPOWER on IntegriCloud