Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> writes: > On Mon, Nov 30, 2020 at 8:17 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote: >> >> When we added sanitising of map names before loading programs to libbpf, we >> still allowed periods in the name. While the kernel will accept these for >> the map names themselves, they are not allowed in file names when pinning > > That sounds like an unnecessary difference in kernel behavior. If the > kernel allows maps with '.' in the name, why not allow to pin it? > Should we fix that in the kernel? Yeah, it is a bit odd. I always assumed the restriction in file names is to prevent people from creating hidden (.-prefixed) files in bpffs? But don't actually know for sure. Anyway, if that is the case we could still allow periods in the middle of names. I'm certainly not opposed to changing the kernel behaviour and I can follow up with a patch for this if others agree; but we obviously still need this for older kernels so I'll send a v2 with the helper method you suggested below. -Toke