Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
29efc32d
Unverified
Commit
29efc32d
authored
Feb 15, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: improve cgroup mounting
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
253990c2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
cgfsng.c
src/lxc/cgroups/cgfsng.c
+14
-7
log.h
src/lxc/log.h
+7
-0
No files found.
src/lxc/cgroups/cgfsng.c
View file @
29efc32d
...
...
@@ -1930,16 +1930,23 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open %d(%s)"
,
rootfs
->
dfd_mnt
,
DEFAULT_CGROUP_MOUNTPOINT_RELATIVE
);
if
(
in_cgroup_ns
&&
wants_force_mount
)
{
/*
* If cgroup namespaces are supported but the container
* will not have CAP_SYS_ADMIN after it has started we
* need to mount
the cgroups manually.
* If cgroup namespaces are supported but the container will
* not have CAP_SYS_ADMIN after it has started we need to mount
*
the cgroups manually.
*/
return
cg_mount_in_cgroup_namespace
(
type
,
ops
->
unified
,
rootfs
,
dfd_mnt_cgroupfs
,
""
)
==
0
;
}
if
(
in_cgroup_ns
&&
wants_force_mount
)
ret
=
cg_mount_in_cgroup_namespace
(
type
,
ops
->
unified
,
rootfs
,
dfd_mnt_cgroupfs
,
""
);
else
ret
=
cg_mount_cgroup_full
(
type
,
ops
->
unified
,
rootfs
,
dfd_mnt_cgroupfs
,
""
);
if
(
ret
<
0
)
return
syserrno
(
false
,
"Failed to%s mount cgroup filesystem%s"
,
wants_force_mount
?
" force mount"
:
""
,
in_cgroup_ns
?
" in cgroup namespace"
:
""
);
return
cg_mount_cgroup_full
(
type
,
ops
->
unified
,
rootfs
,
dfd_mnt_cgroupfs
,
""
)
==
0
;
return
log_trace
(
true
,
"%s cgroup filesystem%s"
,
wants_force_mount
?
"Force mounted"
:
"Mounted"
,
in_cgroup_ns
?
" in cgroup namespace"
:
""
);
}
/*
...
...
src/lxc/log.h
View file @
29efc32d
...
...
@@ -494,6 +494,13 @@ __lxc_unused static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
__internal_ret__; \
})
#define syserrno(__ret__, format, ...) \
({ \
typeof(__ret__) __internal_ret__ = (__ret__); \
SYSERROR(format, ##__VA_ARGS__); \
__internal_ret__; \
})
#define log_error(__ret__, format, ...) \
({ \
typeof(__ret__) __internal_ret__ = (__ret__); \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment