Re: [PATCH net] net: vlan: fix vlan name truncation

From: David Laight

Date: Fri Sep 11 2026 - 17:58:58 EST


On Fri, 11 Sep 2026 19:35:43 +0300
Janis Edvarts Lacis <janislacis06@xxxxxxxxx> wrote:

> On Thu, Sep 10, 2026 at 10:56 AM, Paolo Abeni wrote:
> > I'm sorry, but I don't think we can accept this patch: this change an
> > user-space visible behavior: ...
>
> Okay, I see the issue. How about a 'solution' like this: we use scnprintf()
> instead of snprintf() in two branches that can have the name truncated? From
> what I see, the only difference between snprintf() and scnprintf() is the
> return value so there should be no functional change visible to the user. I
> tested the W=1 build, the warning is gone if scnprintf() is used.

I think that ought to be considered a bug in the compiler options.
There is no real justification for snprintf() and scnprintf() being different
(especially if the result is ignored).

David