Re: [RFC PATCH] vfs: syscalls: Add create_automount() and remove_automount()

From: David Howells
Date: Wed Feb 19 2020 - 10:08:18 EST


Oops... I've just realised that the function names in the subject line don't
match those in the patch.

Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:

> The above nicely explains what the patch does.
> However, unless I'm missing something, this fails to explain the "why"
> (except for the vague "[...] is something that AFS needs ...".

I'm not allowed to implement pioctl() for Linux, so I have to find some other
'structured' (to quote Linus) way to implement the extra functions for the
in-kernel AFS client.

OpenAFS and maybe Coda, for example, create a magic file, I think, and then
ioctl is done on that - ie. direct pioctl emulation. All the path lookup and
security is done inside the filesystem.

Another way to do this, at least for these two operations, would be to issue
an ioctl on the parent directory. This requires you to be able to open said
directory in order to perform the ioctl on it - which requires you to have
read permission, something not required to alter a directory. This also
pushes the path lookup and security into the filesystem

So I'm proposing this way. It's something that can be used by other
filesystems too, if they support it. Coda and OpenAFS, for example, might be
able to make use of it as they want to be able to do the same sort of things.

David