Re: [PATCH] SYS: refactor sethostname setdomainname by introducing shared helper

From: Christian Brauner

Date: Fri Nov 20 2026 - 04:42:33 EST


On Thu, Nov 12, 2026 at 09:11:32AM +0100, Laurijssen wrote:
> into a new helper, utsname_set_field. The existing implementation
> duplicated validation, size checks, and uts namespace update steps that
> are also needed by upcoming changes in related syscalls.

What upcoming changes? If there are any, send this together with them.

> The helper centralizes:
> - updates to utsname()->nodename/domainname with proper locking
> - propagation rules for shared uts namespaces.

There are no propagation rules for uts namespaces. The helper does
exactly what the two syscalls do today.

> handling. The patch reduces code duplication, improves maintainability
> and prepares for future extensions to utsname management.

It adds a line and a switch with a WARN_ON_ONCE() for a case that can't
happen. Seems like churn.