Re: [PATCH RFC v2] fhandle: expose u64 mount id to name_to_handle_at(2)

hch
2024-05-28T07:15:55Z

On Tue, May 28, 2024 at 09:12:33AM +0200, Christian Brauner wrote:
> It's also used by userspace for uniquely identifying cgroups via handles
> as cgroups and - even without open_by_handle_at() - to check whether a
> file is still valid.
>
> And again a 64bit mount is is a simple way to race-free go to whatever
> superblock uuid you want. They cannot be recycled and are unique for the
> lifetime of the system.

And then break when you reboot. Which you might not care about for
cgroups, but which is really bad for the concept of a file handle.

See one of my other replies for a proposed interface that is just as
easy to use for userspace, a little more complex in the kernel but
safe for it. I'd much prefer that over using ay kind of "mount ID"
which doesn't fit into the file handle concept at all.