func detectMountpointInternal(m mount.Interface, path string) (string, error) {
	for path != "" && path != "/" {
		// per k8s.io/utils/mount/mount_linux this detects all but
		// a bind mount from one part of a mount to another.
		// For our purposes that's fine; we simply want the "true"
		// mount point
		//
		// IsNotMountPoint proved much more troublesome; it actually
		// scans the mounts, and when a lot of mount/unmount
		// activity takes place, it is not able to get a consistent
		// view of /proc/self/mounts, causing it to time out and
		// report incorrectly.
		isNotMount, err := m.IsLikelyNotMountPoint(path)
		if err != nil {
			return "/", err
		}
		if !isNotMount {
			return path, nil
		}
		path = filepath.Dir(path)
	}
	return "/", nil
}
// Assumes that the path has been fully canonicalized
// Breaking this up helps with testing
Assumes that the path has been fully canonicalized
Breaking this up helps with testing
// Assumes that the path has been fully canonicalized // Breaking this up helps with testing
func detectMountpointInternal(m mount.Interface, path string) (string, error) {
	for path != "" && path != "/" {
		 IsNotMountPoint proved much more troublesome; it actually
		 scans the mounts, and when a lot of mount/unmount
		 activity takes place, it is not able to get a consistent
		 view of /proc/self/mounts, causing it to time out and
		 report incorrectly.
		isNotMount, err := m.IsLikelyNotMountPoint(path)
		if err != nil {
			return "/", err
		}
		if !isNotMount {
			return path, nil
		}
		path = filepath.Dir(path)
	}
	return "/", nil
}
func detectMountpointInternal ( m mount . Interface , path string ) ( string , error ) { for path != " " && path != " " { isNotMount , err := m . IsLikelyNotMountPoint ( path ) if err != nil { return " " , err } if ! isNotMount { return path , nil } path = filepath . Dir ( path ) } return " " , nil }
Assumes that the path has been fully canonicalized
Breaking this up helps with testing
Assumes that the path has been fully canonicalized Breaking this up helps with testing
// per k8s.io/utils/mount/mount_linux this detects all but // a bind mount from one part of a mount to another. // For our purposes that's fine; we simply want the "true" // mount point // // IsNotMountPoint proved much more troublesome; it actually // scans the mounts, and when a lot of mount/unmount // activity takes place, it is not able to get a consistent // view of /proc/self/mounts, causing it to time out and // report incorrectly.