Re: [PATCH] mm/cma_debug.c: align the name buffer length as struct cma

From: Andrew Morton
Date: Wed Jul 20 2022 - 13:02:50 EST


On Wed, 20 Jul 2022 10:45:33 +0000 "Kassey Li (QUIC)" <quic_yingangl@xxxxxxxxxxx> wrote:

> Hi, Andrew:
>
> Is it the case that the output is never >16 chars anyway? If so, we'll be OK.
> >> Yes. I verified on my device by giving cma.name length l< 16 and >16 both. Result is OK. I mean > 16 showed correctly with this patch.
> >> without this patch, cma.name > 16, only showed 16 characters.
>

Well that's my point. With this patch the output is changed and this
might break userspace code which expects the truncation.

That should be OK as there are no guarantees with debugfs interfaces.
I added this as the patch's changelog:


: Avoids truncating the debugfs output to 16 chars. Potentially alters
: the userspace output, but this is a debugfs interface and there are no
: stability guarantees.