Commit b8ddf85d authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

cgroup: Split net_prio.ifpriomap writes

At this moment the kernel doesn't support multi-line write()
to net_prio.ifpriomap. On such write the kernel will parse
only the first line.

That results in the following failed restore:
> (01.454153) cg: Restoring cgroup property value [lo 0
> enp5s0 0
> enp6s0 0
> br0 0
> venet0 0
> host-routed 0
> virbr0 0
> virbr0-nic 0] to [net_prio,net_cls/machine.slice/91d3ac46-380e-4d91-89d3-d2bd1eb30f97/net_prio.ifpriomap]
> (01.454188) Error (criu/cgroup.c:1225): cg: Failed writing lo 0
> enp5s0 0
> enp6s0 0
> br0 0
> venet0 0
> host-routed 0
> virbr0 0
> virbr0-nic 0 to net_prio,net_cls/machine.slice/91d3ac46-380e-4d91-89d3-d2bd1eb30f97/net_prio.ifpriomap: Argument list too long
> (01.472144) Error (criu/cr-restore.c:1013): 20509 killed by signal 9: Killed
> (01.472391) mnt: Switching to new ns to clean ghosts
> (01.472690) Error (criu/cr-restore.c:2007): Restoring FAILED.
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 3fbc10f7
...@@ -1322,6 +1322,7 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e ...@@ -1322,6 +1322,7 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e
off2 += sprintf(path + off, "/%s", e->dir_name); off2 += sprintf(path + off, "/%s", e->dir_name);
for (j = 0; j < e->n_properties; ++j) { for (j = 0; j < e->n_properties; ++j) {
CgroupPropEntry *p = e->properties[j]; CgroupPropEntry *p = e->properties[j];
bool split = false;
if (!strcmp(p->name, "freezer.state")) { if (!strcmp(p->name, "freezer.state")) {
add_freezer_state_for_restore(p, path, off2); add_freezer_state_for_restore(p, path, off2);
...@@ -1336,7 +1337,11 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e ...@@ -1336,7 +1337,11 @@ static int prepare_cgroup_dir_properties(char *path, int off, CgroupDirEntry **e
if (is_special_property(p->name)) if (is_special_property(p->name))
continue; continue;
if (restore_cgroup_prop(p, path, off2, false) < 0) /* The kernel can't handle it in one write() */
if (strcmp(p->name, "net_prio.ifpriomap") == 0)
split = true;
if (restore_cgroup_prop(p, path, off2, split) < 0)
return -1; return -1;
} }
skip: skip:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment