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
b9138559
Commit
b9138559
authored
Feb 19, 2016
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #829 from hallyn/2016-02-19/devices
cgroups: do not fail if setting devices cgroup fails due to EPERM
parents
ef95dc01
4f875f70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
cgfs.c
src/lxc/cgfs.c
+8
-0
cgmanager.c
src/lxc/cgmanager.c
+8
-0
No files found.
src/lxc/cgfs.c
View file @
b9138559
...
@@ -1285,10 +1285,13 @@ static int lxc_cgroup_set_data(const char *filename, const char *value, struct c
...
@@ -1285,10 +1285,13 @@ static int lxc_cgroup_set_data(const char *filename, const char *value, struct c
if
((
p
=
strchr
(
subsystem
,
'.'
))
!=
NULL
)
if
((
p
=
strchr
(
subsystem
,
'.'
))
!=
NULL
)
*
p
=
'\0'
;
*
p
=
'\0'
;
errno
=
ENOENT
;
path
=
lxc_cgroup_get_hierarchy_abs_path_data
(
subsystem
,
d
);
path
=
lxc_cgroup_get_hierarchy_abs_path_data
(
subsystem
,
d
);
if
(
path
)
{
if
(
path
)
{
ret
=
do_cgroup_set
(
path
,
filename
,
value
);
ret
=
do_cgroup_set
(
path
,
filename
,
value
);
int
saved_errno
=
errno
;
free
(
path
);
free
(
path
);
errno
=
saved_errno
;
}
}
return
ret
;
return
ret
;
}
}
...
@@ -1915,6 +1918,11 @@ static int do_setup_cgroup_limits(struct cgfs_data *d,
...
@@ -1915,6 +1918,11 @@ static int do_setup_cgroup_limits(struct cgfs_data *d,
cgroup_devices_has_allow_or_deny
(
d
,
cg
->
value
,
true
))
cgroup_devices_has_allow_or_deny
(
d
,
cg
->
value
,
true
))
continue
;
continue
;
if
(
lxc_cgroup_set_data
(
cg
->
subsystem
,
cg
->
value
,
d
))
{
if
(
lxc_cgroup_set_data
(
cg
->
subsystem
,
cg
->
value
,
d
))
{
if
(
do_devices
&&
errno
==
EPERM
)
{
WARN
(
"Error setting %s to %s for %s"
,
cg
->
subsystem
,
cg
->
value
,
d
->
name
);
continue
;
}
ERROR
(
"Error setting %s to %s for %s"
,
ERROR
(
"Error setting %s to %s for %s"
,
cg
->
subsystem
,
cg
->
value
,
d
->
name
);
cg
->
subsystem
,
cg
->
value
,
d
->
name
);
goto
out
;
goto
out
;
...
...
src/lxc/cgmanager.c
View file @
b9138559
...
@@ -1523,6 +1523,14 @@ static bool cgm_setup_limits(void *hdata, struct lxc_list *cgroup_settings, bool
...
@@ -1523,6 +1523,14 @@ static bool cgm_setup_limits(void *hdata, struct lxc_list *cgroup_settings, bool
d
->
cgroup_path
,
cg
->
subsystem
,
cg
->
value
)
!=
0
)
{
d
->
cgroup_path
,
cg
->
subsystem
,
cg
->
value
)
!=
0
)
{
NihError
*
nerr
;
NihError
*
nerr
;
nerr
=
nih_error_get
();
nerr
=
nih_error_get
();
if
(
do_devices
)
{
WARN
(
"call to cgmanager_set_value_sync failed: %s"
,
nerr
->
message
);
nih_free
(
nerr
);
WARN
(
"Error setting cgroup %s:%s limit type %s"
,
controller
,
d
->
cgroup_path
,
cg
->
subsystem
);
continue
;
}
ERROR
(
"call to cgmanager_set_value_sync failed: %s"
,
nerr
->
message
);
ERROR
(
"call to cgmanager_set_value_sync failed: %s"
,
nerr
->
message
);
nih_free
(
nerr
);
nih_free
(
nerr
);
ERROR
(
"Error setting cgroup %s:%s limit type %s"
,
controller
,
ERROR
(
"Error setting cgroup %s:%s limit type %s"
,
controller
,
...
...
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