Re: design: was: Re: [RFC PATCH v2] printk: console: Allow each console to have its own loglevel

From: Petr Mladek
Date: Tue Jul 19 2022 - 09:47:18 EST


On Tue 2022-07-19 13:11:25, Chris Down wrote:
> Chris Down writes:
> > Ok, I will incorporate the EINVAL return for sysctl in a separate patch
> > first, and then add the new sysfs one to the existing changes for v3.
> > :-)
>
> Thinking more about this, I will probably not change the existing
> kernel.printk semantics to return EINVAL, since it could silently(ish) cause
> regressions for existing misconfigured systems on boot. I'll just add the
> clamps to the new controls.

I guess that you are talking about the obsoleted sysctl
'kernel.printk' that has 4 values. And about syslog
behavior. I agree that changing he behavior might be risky.

But I think that we should return EINVAL in the newly added
interface. IMHO, people should know when the entered value
can't be used instead of silently changing it.

When talking about the new interface. I would either do not create
/proc/sys/kernel/minimum_console_loglevel or I would make it read
only. IMHO, this value was supposed to be a built in value and
was exported without much thinking. I guess that only few people know
what it really does and it is better to hide it.

Best Regards,
Petr