You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on some cgroups related changes, I've found that the Interop.cgroups.FindCGroupsVersion was unable to detect cgroups v1. I've investigated the issue and the problem is caused by the fact that the textual result of new DriveInfo(SysFsCgroupFileSystemPath).DriveFormat returns udev instead of tmpfs. The reason is that we get the format string from the UnixFileSystemTypes enum based on the filesystem "magic" constant and the udev and tmpfs (and few others) share the same value.
The DriveInfo calls Interop.Sys.GetFormatInfoForMountPoint that converts the filesystem numeric type (the magic constant) using this:
While working on some cgroups related changes, I've found that the
Interop.cgroups.FindCGroupsVersion
was unable to detect cgroups v1. I've investigated the issue and the problem is caused by the fact that the textual result ofnew DriveInfo(SysFsCgroupFileSystemPath).DriveFormat
returnsudev
instead oftmpfs
. The reason is that we get the format string from theUnixFileSystemTypes
enum based on the filesystem "magic" constant and theudev
andtmpfs
(and few others) share the same value.The
DriveInfo
callsInterop.Sys.GetFormatInfoForMountPoint
that converts the filesystem numeric type (the magic constant) using this:runtime/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs
Lines 62 to 63 in ccc475e
The
Interop.cgroups.FindCGroupsVersion
uses this switch to detect cgroups version:runtime/src/libraries/Common/src/Interop/Linux/cgroups/Interop.cgroups.cs
Lines 115 to 120 in ccc475e
Since the name returned by the
Enum.ToString
is "udev", it fails to detect the cgroups 1.The text was updated successfully, but these errors were encountered: