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

Alejandro Colomar <[email protected]> Thu, 5 Mar 2026 01:42:57 +0100
Newsgroups dev.linux.lists.criu,org.kernel.vger.linux-man
Message-ID <aajREfJrV15V7HPe@devuan>
On 2026-03-05T03:13:37+0300, Askar Safin 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".

Except for expanding fd by file descriptor, what you say sounds
reasonable to me.

> 
> The only difference between fd, returned by fsmount, and normal O_PATH
> descriptor is that fd, returned by fsmount, has FMODE_NEED_UNMOUNT flag
> on file description:
> https://elixir.bootlin.com/linux/v7.0-rc1/source/fs/namespace.c#L4495 .
> 
> This FMODE_NEED_UNMOUNT means that when we close fd, the mount is unmounted.
> 
> 
> 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.

Thanks for having a look!  And thanks for confirming it's correct!


Have a lovely night!
Alex

> 
> -- 
> Askar Safin
> 

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmmo0YsACgkQ64mZXMKQ
wqlURhAAmZ3tkLtixLMoxdKHUPma4Sy4JUn2Xt5c1m8tVvnzVlTvlQFwK7/t5CST
MMlt/NbSlJmY6g+c6fQYBuk32SpYwEZLCkOqz1122/RrFsInqSHBJHtwoXNpe7Pj
doiLV7ewu9q4RnrW+tsR/fLBNmvi78IGDpLOmCrQimL1EkxiwOXlt9dxdk5XnP+J
JlcxDo+xkY8z1bfO2izLmox+q9QX6lOIW3+KvnMB650mjkNo738JgBulhALXOifR
+x3LJh58GoUv0my1xrlOKzLGis0MEYZ0Nyn59yBsEpMho1ztLAMt1SoQyPOAOVX3
ZkPT0mkSdy2H50oZFIX2AO1o+LDrzem5Sgfcp3xg7WJ2Lu+xcKjsJxasshWz97ex
8VlAHgezX/LPEA5heqssGtWdLALKdYFA1wGvBVmCLwVwNi6OGeZrvv6KTHIKMYJA
dfFtRbu5/ewHmq8u1A5BmZthsQDwB8iYEyr6RkGShbEyDUHObIQlhdu4DOPdY+/q
FUjZ4uwJe9RhF5wk+gfvTlulJ9WVJIGh7JfDP0CqNlIINODoNtAGadgYxCiAxs4r
O17hFexqQ5ZQ7tVOG9Cm8Pyv0DitXXyPnaij0e1Dx6hbBuqNAwtIFVzlKmIbBOV6
OGoAChj/NUjhLczXp5q5lv/CRQjg8v3ldJW59EwNPrGPYzsfg04=
=dw2W
-----END PGP SIGNATURE-----