[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d4c6f30-1262-461c-9fb8-25f7c8f4ad0e@arm.com>
Date: Tue, 16 Dec 2025 14:58:14 +0000
From: Ryan Roberts <ryan.roberts@....com>
To: Kevin Brodsky <kevin.brodsky@....com>, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...nel.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Mark Brown
<broonie@...nel.org>, Shuah Khan <shuah@...nel.org>,
Usama Anjum <Usama.Anjum@....com>
Subject: Re: [PATCH 4/4] selftests/mm: fix exit code in pagemap_ioctl
On 16/12/2025 14:26, Kevin Brodsky wrote:
> pagemap_ioctl always reports success, whether the tests succeeded or
> not. Call ksft_finished() to report the right status.
>
> While at it also fix the exit code in unexpected situations:
>
> - Report SKIP if userfaultfd isn't available (in line with other
> tests)
>
> - Report FAIL if we failed to open /proc/self/pagemap (returning
> -EINVAL from main() is meaningless)
>
> Cc: Usama Anjum <Usama.Anjum@....com>
> Signed-off-by: Kevin Brodsky <kevin.brodsky@....com>
Reviewed-by: Ryan Roberts <ryan.roberts@....com>
> ---
> tools/testing/selftests/mm/pagemap_ioctl.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c
> index 67a7a3705604..aeedb96dfffb 100644
> --- a/tools/testing/selftests/mm/pagemap_ioctl.c
> +++ b/tools/testing/selftests/mm/pagemap_ioctl.c
> @@ -1553,7 +1553,7 @@ int main(int __attribute__((unused)) argc, char *argv[])
> ksft_print_header();
>
> if (init_uffd())
> - ksft_exit_pass();
> + ksft_exit_skip("Failed to initialize userfaultfd\n");
>
> ksft_set_plan(117);
>
> @@ -1562,7 +1562,7 @@ int main(int __attribute__((unused)) argc, char *argv[])
>
> pagemap_fd = open(PAGEMAP, O_RDONLY);
> if (pagemap_fd < 0)
> - return -EINVAL;
> + ksft_exit_fail_msg("Failed to open " PAGEMAP "\n");
>
> /* 1. Sanity testing */
> sanity_tests_sd();
> @@ -1734,5 +1734,5 @@ int main(int __attribute__((unused)) argc, char *argv[])
> zeropfn_tests();
>
> close(pagemap_fd);
> - ksft_exit_pass();
> + ksft_finished();
> }
Powered by blists - more mailing lists