Re: [PATCH] EDAC/octeon: enlarge the L2C error message buffer
From: Aibing Chen
Date: Sun Dec 06 2026 - 09:28:34 EST
Hi Boris, Thomas,
On Sat, Dec 05, 2026 at 02:00:20PM -0800, Borislav Petkov wrote:
> Btw, I'm still open about fixing this buffer thing properly if it is
> actually a problem but not based on some heuristic only.
You are right, and after checking the field widths I do not think this is
a real problem. buf1 is built with
snprintf(buf1, sizeof(buf1), "type:%d, syn:0x%x, way:%d", ...)
and the fields are
type: 2 bits -> 1 digit
syn: 10 bits -> "0x3ff", 3 hex digits
wayidx:18 bits -> 6 digits
so the longest possible buf1 is
"type:3, syn:0x3ff, way:262143" (29 characters)
The longest prefix used for buf2 is "Tag Single bit error (corrected):"
at 32 characters, so buf2 tops out at 62 bytes and the 80 byte array is
enough. gcc derived its 97 bytes from the size of buf1 (63 characters),
not from what that format can actually produce.
Please drop the patch; sorry for the noise. I will be more careful with
-Wformat-truncation reports where the source buffer cannot be reached at
its full length.
The DIMM label patch is the same class of report, so I will not insist on
growing the buffer there either - I will follow whatever you prefer.
Thanks,
Aibing