Skip to content

Commit

Permalink
libct/intelrdt: explain why mountinfo is required
Browse files Browse the repository at this point in the history
For the Nth time I wanted to replace parsing mountinfo with
statfs and the check for superblock magic, but it is not possible
since some code relies of mount options check which can only
be obtained via mountinfo.

Add a note about it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 5e201e7)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin authored and lifubang committed Aug 10, 2023
1 parent 5ba1b8e commit dfdc7d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libcontainer/intelrdt/intelrdt.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ func Root() (string, error) {
return
}

// NB: ideally, we could just do statfs and RDTGROUP_SUPER_MAGIC check, but
// we have to parse mountinfo since we're also interested in mount options.
root, err := findIntelRdtMountpointDir()
if err != nil {
intelRdtRootErr = err
Expand Down

0 comments on commit dfdc7d0

Please sign in to comment.