mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
util: do not use mount-utils.IsLikelyNotMountPoint
anymore
`IsLikelyNotMountPoint()` is an optimized version for `IsMountPoint()` which can not detect all type of mounts (anymore). The slower `IsMountPoint()` is more safe to use. This can cause a slight performance regression in the case there are many mountpoints on the system, but correctness is more important than speed while mounting. Fixes: #4633 Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
76b4f53897
commit
79cf0321dd
16
vendor/github.com/moby/sys/userns/userns.go
generated
vendored
Normal file
16
vendor/github.com/moby/sys/userns/userns.go
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
// Package userns provides utilities to detect whether we are currently running
|
||||
// in a Linux user namespace.
|
||||
//
|
||||
// This code was migrated from [libcontainer/runc], which based its implementation
|
||||
// on code from [lcx/incus].
|
||||
//
|
||||
// [libcontainer/runc]: https://github.com/opencontainers/runc/blob/3778ae603c706494fd1e2c2faf83b406e38d687d/libcontainer/userns/userns_linux.go#L12-L49
|
||||
// [lcx/incus]: https://github.com/lxc/incus/blob/e45085dd42f826b3c8c3228e9733c0b6f998eafe/shared/util.go#L678-L700
|
||||
package userns
|
||||
|
||||
// RunningInUserNS detects whether we are currently running in a Linux
|
||||
// user namespace and memoizes the result. It returns false on non-Linux
|
||||
// platforms.
|
||||
func RunningInUserNS() bool {
|
||||
return inUserNS()
|
||||
}
|
Reference in New Issue
Block a user