userfaultfd: selftest: explicit failure if the SIGBUS test failed
authorAndrea Arcangeli <[email protected]>
Wed, 6 Sep 2017 23:23:49 +0000 (16:23 -0700)
committerLinus Torvalds <[email protected]>
Thu, 7 Sep 2017 00:27:29 +0000 (17:27 -0700)
Showing zero in the output isn't very self explanatory as a successful
result.  Show a more explicit error output if the test fails.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrea Arcangeli <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Alexey Perevalov <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Mike Kravetz <[email protected]>
Cc: Mike Rapoport <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
tools/testing/selftests/vm/userfaultfd.c

index 4549ae425f3ecec636b140dc26539e171a2c1275..a2c53a3d223d336e29a2e54f2e108a1c51810dae 100644 (file)
@@ -987,7 +987,9 @@ static int userfaultfd_sig_test(void)
                return 1;
 
        printf("done.\n");
-       printf(" Signal test userfaults: %ld\n", userfaults);
+       if (userfaults)
+               fprintf(stderr, "Signal test failed, userfaults: %ld\n",
+                       userfaults);
        close(uffd);
        return userfaults != 0;
 }