Commit e6d3eb2
committed
Handle already-mounted cgroups in cgroup_init()
Add handling for EBUSY when mounting cgroup2 filesystem, which occurs
when cgroups are already mounted. This can happen after switch_root
when cgroups were moved from the initramfs, or in container environments.
Verify the existing mount is actually cgroup2 before proceeding, and
track whether we mounted to avoid unmounting on error if we didn't.1 parent d7fd5bc commit e6d3eb2
1 file changed
+32
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
841 | 843 | | |
842 | 844 | | |
843 | 845 | | |
| 846 | + | |
844 | 847 | | |
845 | 848 | | |
846 | 849 | | |
| |||
851 | 854 | | |
852 | 855 | | |
853 | 856 | | |
854 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
855 | 872 | | |
856 | | - | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
857 | 877 | | |
858 | | - | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
859 | 881 | | |
860 | | - | |
861 | | - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
862 | 887 | | |
863 | 888 | | |
864 | 889 | | |
| |||
867 | 892 | | |
868 | 893 | | |
869 | 894 | | |
870 | | - | |
| 895 | + | |
| 896 | + | |
871 | 897 | | |
872 | 898 | | |
873 | 899 | | |
| |||
0 commit comments