Re: [PATCH v3] man/man2/statmount.2: Document STATMOUNT_BY_FD
From: Askar Safin <hidden>
Date: 2026-03-05 00:15:34
Alejandro Colomar [off-list ref]:
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". 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. -- Askar Safin