From d312cb1e4884c606bafe6499fade2f91ccc2e944 Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Wed, 6 Sep 2017 16:23:49 -0700 Subject: [PATCH] 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@redhat.com Signed-off-by: Andrea Arcangeli Cc: "Dr. David Alan Gilbert" Cc: Alexey Perevalov Cc: Maxime Coquelin Cc: Mike Kravetz Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- tools/testing/selftests/vm/userfaultfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index 4549ae425f3e..a2c53a3d223d 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/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; }