[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3977a1f7-eb5c-2d12-fa62-d501c56d3d9b@amd.com>
Date: Thu, 13 Oct 2022 14:35:48 +0100
From: Edward Cree <ecree@....com>
To: Jiri Pirko <jiri@...nulli.us>,
Johannes Berg <johannes@...solutions.net>
Cc: Edward Cree <ecree.xilinx@...il.com>, netdev@...r.kernel.org,
linux-net-drivers@....com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com, habetsm.xilinx@...il.com,
marcelo.leitner@...il.com
Subject: Re: [RFC PATCH net-next 1/3] netlink: add support for formatted
extack messages
On 13/10/2022 13:59, Jiri Pirko wrote:
> I think that the macro caller need to take the buffer size into account
> passing the formatted msg. So if the generated message would not fit
> into the buffer, it's a caller bug. WARN_ON() is suitable for such
> things, as it most probaly will hit the developer testing newly added
> exack message.
I disagree, extack is a best-effort diagnostic channel and it's valid
for a caller to rely on e.g. %pI6c to generate messages that *usually*
fit but can't be guaranteed to. And original dev might well not see
the WARN_ON() because he's using addresses like fc00::123 in his tests
whereas the end user — who maybe has panic_on_warn enabled — has a
real-world address that takes 30+ bytes to print.
Then there's things like %d which can vary in length by a factor of 10.
I think the net_warn_ratelimited() with the full message, as I've used
in v2, is plenty loud enough.
-ed
Powered by blists - more mailing lists