Re: [LTP] [PATCH] ioctl_pidfd02-06: Add CONFIG_USER_NS and CONFIG_PID_NS to needs_kconfigs

Jan Stancek via ltp
2026-01-08T07:27:45Z

On Wed, Jan 7, 2026 at 5:15 PM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
> > Thanks for your input. I understand that you're for replacing in ioctl_ns06.c:
> >
> > int exists = access("/proc/self/ns/user", F_OK);
> >
> > if (exists < 0)
> > tst_res(TCONF, "namespace not available");
> >
> > with .needs_kconfigs:
> >
> > .needs_kconfigs = (const char *[]) {
> > "CONFIG_USER_NS",
> > NULL
> > }
> >
> > Because that was my question - really always prefer kconfig even there is a
> > simple runtime solution? I'd like to have some "rule" like conclusion we can
> > point during review.
>
> I think that from a long term view this is going to be simpler solution
> than having many different types of checks. The less diverse these
> checks are the easier they are to review and maintain. Hence I lean
> towards kernel config checks even though they are slower (mostly
> unmeasurable on today's harware) than the alternatives.

I think I lean opposite way, and rather have a check for right
environment to support the test.
You can have feature X enabled in kernel config, but still disabled
later at boot/runtime
(e.g. max_user_namespaces=0), or a module simply not being loaded.

>
> --
> Cyril Hrubis
> chrubis@suse.cz
>