Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/mm: fix exit code in pagemap_ioctl

Make sure pagemap_ioctl exits with an appropriate value:

* If the tests are run, call ksft_finished() to report the right
status instead of reporting PASS unconditionally.

* Report SKIP if userfaultfd isn't available (in line with other
tests)

* Report FAIL if we failed to open /proc/self/pagemap, as this file
has been added a long time ago and doesn't depend on any CONFIG
option (returning -EINVAL from main() is meaningless)

Link: https://lkml.kernel.org/r/20260122170224.4056513-9-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Acked-by: SeongJae Park <sj@kernel.org>
Reviewed-by: wang lian <lianux.mm@gmail.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Cc: Usama Anjum <Usama.Anjum@arm.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kevin Brodsky and committed by
Andrew Morton
148e5879 7e938f00

+3 -3
+3 -3
tools/testing/selftests/mm/pagemap_ioctl.c
··· 1552 1552 ksft_print_header(); 1553 1553 1554 1554 if (init_uffd()) 1555 - ksft_exit_pass(); 1555 + ksft_exit_skip("Failed to initialize userfaultfd\n"); 1556 1556 1557 1557 ksft_set_plan(117); 1558 1558 ··· 1561 1561 1562 1562 pagemap_fd = open(PAGEMAP, O_RDONLY); 1563 1563 if (pagemap_fd < 0) 1564 - return -EINVAL; 1564 + ksft_exit_fail_msg("Failed to open " PAGEMAP "\n"); 1565 1565 1566 1566 /* 1. Sanity testing */ 1567 1567 sanity_tests_sd(); ··· 1733 1733 zeropfn_tests(); 1734 1734 1735 1735 close(pagemap_fd); 1736 - ksft_exit_pass(); 1736 + ksft_finished(); 1737 1737 }