Skip to content

Commit f409b65

Browse files
committed
Add a note about STATX_ATTR_MOUNT_ROOT.
Add a note about the possibility of using `STATX_ATTR_MOUNT_ROOT` to detect mountpoints.
1 parent a01f36d commit f409b65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/io/procfs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,10 @@ fn open_and_check_file(dir: BorrowedFd, dir_stat: &Stat, name: &ZStr) -> io::Res
463463
// if we can find a regular file with an inode and name that matches the
464464
// file we just opened. If we can't find it, there could be a file bind
465465
// mount on top of the file we want.
466+
//
467+
// TODO: With Linux 5.8 we might be able to use `statx and
468+
// `STATX_ATTR_MOUNT_ROOT` to detect mountpoints directly instead of doing
469+
// this scanning.
466470
let dir = Dir::from(dot).map_err(|_err| io::Error::NOTSUP)?;
467471
for entry in dir {
468472
let entry = entry.map_err(|_err| io::Error::NOTSUP)?;

0 commit comments

Comments
 (0)