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

Cyril Hrubis
2026-01-07T16:15:36Z

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.

--
Cyril Hrubis
chrubis@suse.cz