[CRIU] [PATCH] Skip restoring the cgroup root directories when using full mode

Hui Kang hkang.sunysb at gmail.com
Wed Aug 12 14:37:35 PDT 2015


On Wed, Aug 12, 2015 at 5:22 PM, Cyrill Gorcunov <gorcunov at gmail.com> wrote:

> On Wed, Aug 12, 2015 at 07:36:22PM +0000, Hui Kang wrote:
> > Signed-off-by: Hui Kang <hkang.sunysb at gmail.com>
> > ---
> >  cgroup.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/cgroup.c b/cgroup.c
> > index a4e0146..51348ca 100644
> > --- a/cgroup.c
> > +++ b/cgroup.c
> > @@ -992,6 +992,10 @@ static int prepare_cgroup_dir_properties(char
> *path, int off, CgroupDirEntry **e
> >               CgroupDirEntry *e = ents[i];
> >               size_t off2 = off;
> >
> > +             if (strcmp(e->dir_name, "") ==0)  {
> > +                     continue;
> > +             }
> > +
> >               off2 += sprintf(path + off, "/%s", e->dir_name);
> >               if (e->n_properties > 0) {
> >                       for (j = 0; j < e->n_properties; ++j) {
>
> Could you please explain how we end up having empty dir_name here?
>

This happens when restoring a process with cgroup using
--manage-cgroup=full.

To reproduce this error

1. start a process
2. mkdir /sys/fs/cgroups/cpusets/foo
3. echo PID > /sys/fs/cgroups/cpusets/foo/tasks
4. checkpoint the process
5. rmdir /sys/fs/cgroups/cpusets/foo or copy the checkedpoint images to a
different host
5. /root/criu/criu restore --log-file ./restore.log -vvvv -j
--manage-cgroup=full
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150812/21068d99/attachment.html>


More information about the CRIU mailing list