From: Andrea Arcangeli <aarcange@xxxxxxxxxx> Subject: userfaultfd: selftest: explicit failure if the SIGBUS test failed 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/20170802165145.22628-4-aarcange@xxxxxxxxxx Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> Cc: "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx> Cc: Alexey Perevalov <a.perevalov@xxxxxxxxxxx> Cc: Maxime Coquelin <maxime.coquelin@xxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/vm/userfaultfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN tools/testing/selftests/vm/userfaultfd.c~userfaultfd-selftest-explicit-failure-if-the-sigbus-test-failed tools/testing/selftests/vm/userfaultfd.c --- a/tools/testing/selftests/vm/userfaultfd.c~userfaultfd-selftest-explicit-failure-if-the-sigbus-test-failed +++ a/tools/testing/selftests/vm/userfaultfd.c @@ -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; } _ -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html