Re: [PATCH 2/4] fs/namespace: add umounted mounts to umount_mnt_ns
From: Aleksa Sarai
Date: Tue Oct 07 2025 - 14:41:07 EST
On 2025-10-06, Christian Brauner <brauner@xxxxxxxxxx> wrote:
> On Fri, Oct 03, 2025 at 01:03:46PM +0800, Pavel Tikhomirov wrote:
> > 3) We had an alternative approach to make unmounted mounts mountinfo visible
> > for the user, by allowing fd-based statmount() https://github.com/bsach64/linux/commit/ac0c03d44fb1e6f0745aec81079fca075e75b354
> >
> > But we also recognize a problem with it that it would require getting
> > mountinfo from fd which is not root dentry of the mount, but any dentry (as
> > we (CRIU) don't really have an option to choose which fd will be given to
> > us).
>
> The part about this just using an fd is - supresses gag reflex - fine.
> We do that with the mount namespaces for listmount() already via
> mnt_req->spare.
>
> The part that I dislike is exactly the one you pointed out: using an
> arbitrary fd to retrieve information about the mount but it's probably
> something we can live with since the alternative is complicating the
> lifetime rules of the mount and namespace interaction.
Well, to be fair this is basically the fstatfs(2) API so while it is
kind of funky it's not without precedence. open_by_handle_at(2) has
something similar if you don't mind incredibly funky API comparisons. ;)
--
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
https://www.cyphar.com/
Attachment:
signature.asc
Description: PGP signature