File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,22 @@ Since `pivot_root()` only takes path arguments the new rootfs would need to
6363be passed via ` /proc/<pid>/fd/<nr> ` . In the long run we should add a new
6464` pivot_root() ` syscall operating on file descriptors instead of paths.
6565
66+ ### Query mount information via file descriptor with ` statmount() `
67+
68+ Extend ` struct mnt_id_req ` to accept a file descriptor and introduce
69+ ` STATMOUNT_BY_FD ` flag. When a valid fd is provided and ` STATMOUNT_BY_FD `
70+ is set, ` statmount() ` returns mount info about the mount the fd is on.
71+
72+ This works even for "unmounted" mounts (mounts that have been unmounted using
73+ ` umount2(mnt, MNT_DETACH) ` ), if you have access to a file descriptor on that
74+ mount. These unmounted mounts will have no mountpoint and no valid mount
75+ namespace, so ` STATMOUNT_MNT_POINT ` and ` STATMOUNT_MNT_NS_ID ` are unset in
76+ ` statmount.mask ` for such mounts.
77+
78+ ** Use-Case:** Query mount information directly from a file descriptor without
79+ needing the mount ID, which is particularly useful for detached or unmounted
80+ mounts.
81+
6682---
6783
6884### TODO
You can’t perform that action at this time.
0 commit comments