Re: [PATCH v3] man/man2/statmount.2: Document STATMOUNT_BY_FD

Aleksa Sarai <[email protected]> Thu, 5 Mar 2026 13:18:39 +1100
Newsgroups dev.linux.lists.criu,org.kernel.vger.linux-man
Message-ID <[email protected]>
On 2026-03-05, Askar Safin <[email protected]> wrote:
> Alejandro Colomar <[email protected]>:
> > Is this the same as a "mount object file descriptor" as describer in
> > fsopen(2)?  If so, we should use the same language, I think.
> 
> The term "mount object file descriptor" is probably confusing. In fact
> fsmount simply creates detached mount and returns O_PATH fd, referring
> to the root of the new detached mount. (Note: I'm talking about fsmount here,
> not fsopen.) This fd is similar to what open(O_PATH)
> creates. So probably we should just replace this "mount object file
> descriptor" in fsopen(2) with "O_PATH fd".

No. From the perspective of userspace these are different types of
objects, calling them both O_PATH file descriptors is just more
confusing.

The fact that they are "just" an O_PATH to a root mount in an anonymous
namespace with FMODE_NEED_UNMOUNT is an implementation detail, users
reading the docs will be confused if we start referring to two objects
with different semantics as "O_PATH file descriptors" (especially once
you consider that O_PATH file descriptor semantics are also woefully
under-specified).

> This statmount patch refers to any fd inside mount in question. I. e. any
> fd referring to any file inside the mount. This may include O_PATH descriptors
> and, yes, descriptors returned by fsmount. So, current wording in this
> statmount patch is correct.

I agree.

-- 
Aleksa Sarai
https://www.cyphar.com/
signature.asc (application/pgp-signature, 265 B)
-----BEGIN PGP SIGNATURE-----

iJEEABYKADkWIQS2TklVsp+j1GPyqQYol/rSt+lEbwUCaajn/xsUgAAAAAAEAA5t
YW51MiwyLjUrMS4xMSwyLDIACgkQKJf60rfpRG/7WgD/Uiyw8w5GNfwxrgEtKnFG
Kskjkpgo0h2sYB1tS61fC3YBAJGIgAtgShqXyGNm7nRYZ2v54DT0I+05nkZUTiYp
ak8H
=mDTQ
-----END PGP SIGNATURE-----