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
a218be90
Unverified
Commit
a218be90
authored
Feb 16, 2021
by
Stéphane Graber
Committed by
GitHub
Feb 16, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3676 from brauner/2021-02-16/fixes
cgroups: fixes
parents
858f6225
701be30e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
cgfsng.c
src/lxc/cgroups/cgfsng.c
+15
-10
namespace.h
src/lxc/namespace.h
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
a218be90
...
...
@@ -501,7 +501,7 @@ static int add_hierarchy(struct cgroup_ops *ops, char **clist, char *mountpoint,
__do_close
int
dfd_base
=
-
EBADF
,
dfd_mnt
=
-
EBADF
;
__do_free
struct
hierarchy
*
new
=
NULL
;
__do_free_string_list
char
**
controllers
=
clist
;
int
newentry
;
int
idx
;
if
(
abspath
(
container_base_path
))
return
syserrno
(
-
errno
,
"Container base path must be relative to controller mount"
);
...
...
@@ -514,14 +514,13 @@ static int add_hierarchy(struct cgroup_ops *ops, char **clist, char *mountpoint,
if
(
dfd_mnt
<
0
)
return
syserrno
(
-
errno
,
"Failed to open %s"
,
mountpoint
);
if
(
is_empty_string
(
container_base_path
))
dfd_base
=
dfd_mnt
;
else
if
(
!
is_empty_string
(
container_base_path
))
{
dfd_base
=
open_at
(
dfd_mnt
,
container_base_path
,
PROTECT_OPATH_DIRECTORY
,
PROTECT_LOOKUP_BENEATH_XDEV
,
0
);
if
(
dfd_base
<
0
)
return
syserrno
(
-
errno
,
"Failed to open %d(%s)"
,
dfd_base
,
container_base_path
);
if
(
dfd_base
<
0
)
return
syserrno
(
-
errno
,
"Failed to open %d(%s)"
,
dfd_base
,
container_base_path
);
}
if
(
!
controllers
)
{
/*
...
...
@@ -529,7 +528,10 @@ static int add_hierarchy(struct cgroup_ops *ops, char **clist, char *mountpoint,
* us and we are free to further delege all of the controllers listed
* in cgroup.controllers further down the hierarchy.
*/
controllers
=
cg_unified_get_controllers
(
dfd_base
,
"cgroup.controllers"
);
if
(
dfd_base
<
0
)
controllers
=
cg_unified_get_controllers
(
dfd_mnt
,
"cgroup.controllers"
);
else
controllers
=
cg_unified_get_controllers
(
dfd_base
,
"cgroup.controllers"
);
if
(
!
controllers
)
controllers
=
cg_unified_make_empty_controller
();
if
(
!
controllers
[
0
])
...
...
@@ -557,12 +559,15 @@ static int add_hierarchy(struct cgroup_ops *ops, char **clist, char *mountpoint,
for
(
char
*
const
*
it
=
new
->
controllers
;
it
&&
*
it
;
it
++
)
TRACE
(
"The detected hierarchy contains the %s controller"
,
*
it
);
newentry
=
append_null_to_list
((
void
***
)
&
ops
->
hierarchies
);
idx
=
append_null_to_list
((
void
***
)
&
ops
->
hierarchies
);
if
(
dfd_base
<
0
)
new
->
dfd_base
=
dfd_mnt
;
else
new
->
dfd_base
=
move_fd
(
dfd_base
);
new
->
dfd_mnt
=
move_fd
(
dfd_mnt
);
new
->
dfd_base
=
move_fd
(
dfd_base
);
if
(
type
==
CGROUP2_SUPER_MAGIC
)
ops
->
unified
=
new
;
(
ops
->
hierarchies
)[
newentry
]
=
move_ptr
(
new
);
(
ops
->
hierarchies
)[
idx
]
=
move_ptr
(
new
);
return
0
;
}
...
...
src/lxc/namespace.h
View file @
a218be90
...
...
@@ -23,7 +23,7 @@ typedef enum lxc_namespace_t {
__hidden
extern
const
struct
ns_info
{
#define MAX_NS_PROC_NAME 6
const
char
proc_name
[
MAX_NS_PROC_NAME
];
const
char
proc_name
[
MAX_NS_PROC_NAME
+
1
];
const
char
*
proc_path
;
int
clone_flag
;
const
char
*
flag_name
;
...
...
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