Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mountinfo: linux: use /proc/thread-self/mountinfo
In a Go program with many threads, which goroutine is running on the thread-group leader thread is not something programs can controls. Thus, even if you use runtime.LockOSThread() for threads that have different mount namespaces, it's possible that /proc/self will refer to the "wrong" thread. The solution is to simply use /proc/thread-self, which will always provide the correct result for the calling thread. The usage of /proc/self/mountinfo caused isuses for a patch to runc which creates a thread to create id-mapped mounts (which requires joining the container mount namespace). Signed-off-by: Aleksa Sarai <[email protected]>
- Loading branch information