[LTP] [PATCH] userfaultfd05: allow TCONF when UFFD-WP is unsupported
Li Wang
liwang@redhat.com
Thu Jan 22 13:38:36 CET 2026
> > --- a/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c
> > +++ b/testcases/kernel/syscalls/userfaultfd/userfaultfd05.c
> > @@ -92,11 +92,11 @@ static void run(void)
>
> > uffdio_api.api = UFFD_API;
> > uffdio_api.features = UFFD_FEATURE_PAGEFAULT_FLAG_WP;
> > - SAFE_IOCTL(uffd, UFFDIO_API, &uffdio_api);
> > + if (ioctl(uffd, UFFDIO_API, &uffdio_api) < 0) {
> > + if (!(uffdio_api.features & UFFD_FEATURE_PAGEFAULT_FLAG_WP))
> > + tst_brk(TCONF, "UFFD write-protect unsupported");
>
> > - if (!(uffdio_api.features & UFFD_FEATURE_PAGEFAULT_FLAG_WP)) {
> > - tst_brk(TCONF, "UFFD write-protect unsupported");
> > - return;
> > + tst_brk(TBROK | TERRNO, "ioctl_userfaultfd failed");
> very nit: I would write "ioctl() on userfaultfd failed"? I was thinking what
> ioctl_userfaultfd is, but ok, there is man ioctl_userfaultfd(2).
Sure, patch megerd as you suggested, thanks!
--
Regards,
Li Wang
More information about the ltp
mailing list