Re: [PATCH next] ext4: Fix diagnostic printf formats
From: Andy Shevchenko
Date: Fri Mar 27 2026 - 06:52:26 EST
On Thu, Mar 26, 2026 at 08:18:04PM +0000, david.laight.linux@xxxxxxxxx wrote:
> The formats for non-terminated names should be "%.*s" not "%*.s".
> The kernel currently treats "%*.s" as equivalent to "%*s" whereas
> userspace requires it be equivalent to "%*.0s".
> Neither is correct here.
This entire code seems was never tested properly and it's a dead code
until one defines manually DX_DEBUG. It also has tons of plain printk()
calls that may behave differently if the first character is not printable
but maps to the level of printk().
I'm not sure how your patch helps with all that, but apparently the
printed data has to be NUL-terminated, otherwise I have no idea how
it was ever working without crashes.
--
With Best Regards,
Andy Shevchenko