From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Andrea Arcangeli <aarcange@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
peterx@redhat.com, Mike Rapoport <rppt@linux.vnet.ibm.com>
Subject: [PATCH 3/3] userfaultfd/selftests: Hint the test runner on required privilege
Date: Mon, 7 Dec 2020 21:47:09 -0500 [thread overview]
Message-ID: <20201208024709.7701-4-peterx@redhat.com> (raw)
In-Reply-To: <20201208024709.7701-1-peterx@redhat.com>
Now userfaultfd test program requires either root or ptrace privilege due to
the signal/event tests. When UFFDIO_API failed, hint the test runner about
this fact verbosely.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
tools/testing/selftests/vm/userfaultfd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index f0647bfda366..27a1709099d0 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -755,7 +755,8 @@ static int userfaultfd_open(int features)
uffdio_api.api = UFFD_API;
uffdio_api.features = features;
if (ioctl(uffd, UFFDIO_API, &uffdio_api)) {
- fprintf(stderr, "UFFDIO_API\n");
+ fprintf(stderr, "UFFDIO_API failed.\nPlease make sure to "
+ "run with either root or ptrace capability.\n");
return 1;
}
if (uffdio_api.api != UFFD_API) {
--
2.26.2
prev parent reply other threads:[~2020-12-08 2:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 2:47 [PATCH 0/3] userfaultfd: selftests: Small fixes Peter Xu
2020-12-08 2:47 ` [PATCH 1/3] userfaultfd/selftests: Always dump something in modes Peter Xu
2020-12-08 2:47 ` [PATCH 2/3] userfaultfd/selftests: Fix retval check for userfaultfd_open() Peter Xu
2020-12-08 2:47 ` Peter Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201208024709.7701-4-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).