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
5576e5fa
Unverified
Commit
5576e5fa
authored
Sep 24, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfsng: set errno to ENOENT on get_hierarchy()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d80ec04e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
cgfsng.c
src/lxc/cgroups/cgfsng.c
+13
-4
cgroup.h
src/lxc/cgroups/cgroup.h
+1
-0
commands.c
src/lxc/commands.c
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
5576e5fa
...
@@ -179,15 +179,19 @@ static void must_append_controller(char **klist, char **nlist, char ***clist,
...
@@ -179,15 +179,19 @@ static void must_append_controller(char **klist, char **nlist, char ***clist,
/* Given a handler's cgroup data, return the struct hierarchy for the controller
/* Given a handler's cgroup data, return the struct hierarchy for the controller
* @c, or NULL if there is none.
* @c, or NULL if there is none.
*/
*/
struct
hierarchy
*
get_hierarchy
(
struct
cgroup_ops
*
ops
,
const
char
*
c
)
struct
hierarchy
*
get_hierarchy
(
struct
cgroup_ops
*
ops
,
const
char
*
c
ontroller
)
{
{
int
i
;
int
i
;
if
(
!
ops
->
hierarchies
)
errno
=
ENOENT
;
if
(
!
ops
->
hierarchies
)
{
TRACE
(
"There are no useable cgroup controllers"
);
return
NULL
;
return
NULL
;
}
for
(
i
=
0
;
ops
->
hierarchies
[
i
];
i
++
)
{
for
(
i
=
0
;
ops
->
hierarchies
[
i
];
i
++
)
{
if
(
!
c
)
{
if
(
!
c
ontroller
)
{
/* This is the empty unified hierarchy. */
/* This is the empty unified hierarchy. */
if
(
ops
->
hierarchies
[
i
]
->
controllers
&&
if
(
ops
->
hierarchies
[
i
]
->
controllers
&&
!
ops
->
hierarchies
[
i
]
->
controllers
[
0
])
!
ops
->
hierarchies
[
i
]
->
controllers
[
0
])
...
@@ -196,10 +200,15 @@ struct hierarchy *get_hierarchy(struct cgroup_ops *ops, const char *c)
...
@@ -196,10 +200,15 @@ struct hierarchy *get_hierarchy(struct cgroup_ops *ops, const char *c)
continue
;
continue
;
}
}
if
(
string_in_list
(
ops
->
hierarchies
[
i
]
->
controllers
,
c
))
if
(
string_in_list
(
ops
->
hierarchies
[
i
]
->
controllers
,
c
ontroller
))
return
ops
->
hierarchies
[
i
];
return
ops
->
hierarchies
[
i
];
}
}
if
(
controller
)
WARN
(
"There is no useable %s controller"
,
controller
);
else
WARN
(
"There is no empty unified cgroup hierarchy"
);
return
NULL
;
return
NULL
;
}
}
...
...
src/lxc/cgroups/cgroup.h
View file @
5576e5fa
...
@@ -99,6 +99,7 @@ struct cgroup_ops {
...
@@ -99,6 +99,7 @@ struct cgroup_ops {
* hierarchy wins.
* hierarchy wins.
*/
*/
struct
hierarchy
**
hierarchies
;
struct
hierarchy
**
hierarchies
;
/* Pointer to the unified hierarchy. Do not free! */
struct
hierarchy
*
unified
;
struct
hierarchy
*
unified
;
/*
/*
...
...
src/lxc/commands.c
View file @
5576e5fa
...
@@ -654,7 +654,7 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
...
@@ -654,7 +654,7 @@ static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req,
* lxc_unfreeze() would do another cmd (GET_CGROUP) which would
* lxc_unfreeze() would do another cmd (GET_CGROUP) which would
* deadlock us.
* deadlock us.
*/
*/
if
(
cgroup_ops
->
get_cgroup
(
cgroup_ops
,
"freezer"
)
==
NULL
)
if
(
!
cgroup_ops
->
get_cgroup
(
cgroup_ops
,
"freezer"
)
)
return
0
;
return
0
;
if
(
cgroup_ops
->
unfreeze
(
cgroup_ops
))
if
(
cgroup_ops
->
unfreeze
(
cgroup_ops
))
...
...
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