Re: [PATCH] 9p: Avoid creating multiple slab caches with the same name

From: Vlastimil Babka
Date: Mon Oct 21 2024 - 16:18:36 EST


On 10/21/24 20:37, Omar Sandoval wrote:
> On Mon, Oct 21, 2024 at 10:42:02AM +0200, Vlastimil Babka wrote:
>
> FYI, drgn's CI started getting EIO errors from
> getdents("/sys/kernel/slab") that I bisected to this patch. The problem
> is that dev_name can be an arbitrary string. In my case, it is
> "/dev/root". This trips verify_dirent_name(), which fails if a filename
> contains a slash.
>
> This needs to use a different unique identifier. Maybe clnt->msize? But
> then the kmem_caches will need to be shared between different mounts
> using the same msize.

Yep, Dominique mentioned that here too:

https://lore.kernel.org/all/ZvBIl8b9RRK9jgtJ@xxxxxxxxxxxxx/

And yes, slab has internal merging of compatible caches enabled by default.
But since it can be disabled, that would indeed result in duplicate names
again if 9p mounts didn't track and reuse caches with same msize accross
mounts on its own.

Linus's suggestion seems like the easiest fix for now.

> In any case, can this be reverted for now?
>
> Thanks,
> Omar