Re: [PATCH v2 1/1] statmount: accept fd as a parameter

Bhavik Sachdev
2025-10-22T18:12:40Z

On Wed Oct 22, 2025 at 10:02 PM IST, Miklos Szeredi wrote:
> What's wrong with statx + statmount?

We would like to get mountinfo for "unmounted" mounts i.e we have an fd
on a mount that has been unmounted with MNT_DETACH. statmount() does not
work on such mounts (with the mnt_id_unique from statx), since they have
no mount namespace. These mounts also don't show up in proc.

v1 of this patch tried a different approach by introducing a new mount
namespace for "unmounted" mounts, which had a bunch of complications
[1]. The cover letter for this patch also has more information [2].

We want to support checkpoint/restore of such fds with CRIU [3].

[1]: https://lore.kernel.org/all/20251006-erlesen-anlagen-9af59899a969@brauner/
[2]: https://lore.kernel.org/all/20251011124753.1820802-1-b.sachdev1904@gmail.com/
[3]: https://github.com/checkpoint-restore/criu/pull/2754

Kind regards,
Bhavik