Commit 805e6a4
committed
libcrun: skip cgroup filesystem type check when cgroups are disabled
When --cgroup-manager=disabled (force_no_cgroup) is set, crun should
not attempt to detect the cgroup mode by calling statfs on
/sys/fs/cgroup. On systems where /sys/fs/cgroup is not mounted as
tmpfs or cgroup2 (e.g. Android with Linux Deploy where it is mounted
as sysfs), this causes a spurious 'invalid file system type' error
even though cgroups are explicitly disabled.
Guard the libcrun_get_cgroup_mode() calls in
libcrun_container_run_internal() and libcrun_set_mounts() with a check
for force_no_cgroup, so the cgroup filesystem type verification and
the cgroup v1 deprecation warning are both skipped when cgroups are
disabled.
Closes: #1413
Signed-off-by: Jindrich Novy <jnovy@redhat.com>1 parent e5e96a3 commit 805e6a4
3 files changed
+95
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2789 | 2789 | | |
2790 | 2790 | | |
2791 | 2791 | | |
2792 | | - | |
2793 | | - | |
2794 | | - | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
2795 | 2797 | | |
2796 | | - | |
2797 | | - | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
2798 | 2801 | | |
2799 | 2802 | | |
2800 | 2803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2848 | 2848 | | |
2849 | 2849 | | |
2850 | 2850 | | |
2851 | | - | |
2852 | | - | |
2853 | | - | |
2854 | | - | |
2855 | | - | |
| 2851 | + | |
2856 | 2852 | | |
2857 | | - | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
2858 | 2856 | | |
2859 | | - | |
2860 | | - | |
2861 | | - | |
2862 | | - | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
2863 | 2860 | | |
2864 | | - | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
2865 | 2868 | | |
2866 | 2869 | | |
2867 | 2870 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1369 | 1369 | | |
1370 | 1370 | | |
1371 | 1371 | | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
1372 | 1443 | | |
| 1444 | + | |
| 1445 | + | |
1373 | 1446 | | |
1374 | 1447 | | |
1375 | 1448 | | |
| |||
0 commit comments