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
840eec19
Unverified
Commit
840eec19
authored
Feb 21, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: close dfd_mon but keep dfd_con and dfd_lim open for all cgroup hierarchies
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d39f72b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
cgfsng.c
src/lxc/cgroups/cgfsng.c
+11
-2
cgroup.h
src/lxc/cgroups/cgroup.h
+1
-1
start.c
src/lxc/start.c
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
840eec19
...
...
@@ -1364,7 +1364,7 @@ __cgfsng_ops static bool cgfsng_chown(struct cgroup_ops *ops,
return
true
;
}
__cgfsng_ops
static
void
cgfsng_
payload_
finalize
(
struct
cgroup_ops
*
ops
)
__cgfsng_ops
static
void
cgfsng_finalize
(
struct
cgroup_ops
*
ops
)
{
if
(
!
ops
)
return
;
...
...
@@ -1372,6 +1372,15 @@ __cgfsng_ops static void cgfsng_payload_finalize(struct cgroup_ops *ops)
if
(
!
ops
->
hierarchies
)
return
;
for
(
int
i
=
0
;
ops
->
hierarchies
[
i
];
i
++
)
{
struct
hierarchy
*
h
=
ops
->
hierarchies
[
i
];
/* Close all monitor cgroup file descriptors. */
close_prot_errno_disarm
(
h
->
dfd_mon
);
}
/* Close the cgroup root file descriptor. */
close_prot_errno_disarm
(
ops
->
dfd_mnt
);
/*
* The checking for freezer support should obviously be done at cgroup
* initialization time but that doesn't work reliable. The freezer
...
...
@@ -3313,7 +3322,7 @@ struct cgroup_ops *cgroup_ops_init(struct lxc_conf *conf)
cgfsng_ops
->
payload_delegate_controllers
=
cgfsng_payload_delegate_controllers
;
cgfsng_ops
->
payload_create
=
cgfsng_payload_create
;
cgfsng_ops
->
payload_enter
=
cgfsng_payload_enter
;
cgfsng_ops
->
payload_finalize
=
cgfsng_payload
_finalize
;
cgfsng_ops
->
finalize
=
cgfsng
_finalize
;
cgfsng_ops
->
get_cgroup
=
cgfsng_get_cgroup
;
cgfsng_ops
->
get
=
cgfsng_get
;
cgfsng_ops
->
set
=
cgfsng_set
;
...
...
src/lxc/cgroups/cgroup.h
View file @
840eec19
...
...
@@ -218,7 +218,7 @@ struct cgroup_ops {
struct
lxc_handler
*
handler
);
bool
(
*
monitor_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
bool
(
*
payload_delegate_controllers
)(
struct
cgroup_ops
*
ops
);
void
(
*
payload_
finalize
)(
struct
cgroup_ops
*
ops
);
void
(
*
finalize
)(
struct
cgroup_ops
*
ops
);
const
char
*
(
*
get_limiting_cgroup
)(
struct
cgroup_ops
*
ops
,
const
char
*
controller
);
};
...
...
src/lxc/start.c
View file @
840eec19
...
...
@@ -1888,7 +1888,7 @@ static int lxc_spawn(struct lxc_handler *handler)
}
}
cgroup_ops
->
payload_
finalize
(
cgroup_ops
);
cgroup_ops
->
finalize
(
cgroup_ops
);
TRACE
(
"Finished setting up cgroups"
);
if
(
handler
->
ns_unshare_flags
&
CLONE_NEWTIME
)
{
...
...
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