Re: [PATCH] selftests/mm: Specify requirement for PROC_MEM_ALWAYS_FORCE=y

Mike Rapoport
2026-04-17T12:33:44Z

On Fri, Apr 17, 2026 at 12:24:25PM +0100, Mark Brown wrote:
> On Thu, Apr 16, 2026 at 10:28:29PM +0300, Mike Rapoport wrote:
>
> > But sure graceful skips are better than failing the entire tests. Would be
> > something like this:
>
> > @@ -622,10 +621,17 @@ static void test_prot_none(void)
>
> > + mem_fd = open("/proc/self/mem", O_RDWR);
> > + if (mem_fd < 0) {
> > + ksft_test_result_skip("opening /proc/self/mem failed\n");
> > + return;
> > + }
> > +
>
> The string reported in ksft_test_result_*() is the name of the test, it
> should be the same name as is used for pass or fail. This is used to
> correlate test results between runs. The error should be logged with a
> separate print, in this case ksft_perror() is probably a good choice.

This should be probably added to kselftest.h because it's not obvious.

> > {
> > - mem_fd = open("/proc/self/mem", O_RDWR);
> > - if (mem_fd < 0)
> > - ksft_exit_fail_msg("opening /proc/self/mem failed\n");
>
> Yes, this is a preexisting bug in the test which I see there are more
> instances of :(

Do you mean that ksft_exit_fail_msg() should also print the test name and
the actual failure message should be ksft_perror() before?

--
Sincerely yours,
Mike.