[RFC] does # really need to be escaped in devnames?

Linus Torvalds torvalds at linux-foundation.org
Tue Sep 2 13:04:48 PDT 2025


On Tue, 2 Sept 2025 at 10:48, David Howells <dhowells at redhat.com> wrote:
>
> The problem with that is that it appears that people are making use of this.

Ok. So disallowing it isn't in the cards, but let's try to minimize the impact.

> The standard format of AFS volume names is [%#][<cell>:]<volume-name-or-id>
> but I could make it an option to stick something on the front and use that
> internally and display that in /proc/mounts, e.g.:
>
>         mount afs:#openafs.org:afs.root /mnt

Yeah, let's aim for trying to avoid the '#' at the beginning when all
possible, by trying to make at least the default formats not start
with a hash.

And then make the escaping logic only escape the hashmark if it's the
first character.

> I don't think there should be a problem with still accepting lines beginning
> with '#' in mount() if I display them with an appropriate prefix.  That would
> at least permit backward compatibility.

Well, right now we obviously escape it everywhere, but how about we
make it the rule that 'show_devname()' at least doesn't use it as the
first character, and then if somebody uses '#' for the mount name from
user space, we would just do the octal-escape then.

Something ENTIRELY UNTESTED like this, in other words?

                Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 1344 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20250902/21c88b13/attachment.bin>


More information about the linux-afs mailing list