[CRIU] [PATCH 2/2] Attempt to restore cgroups
Tycho Andersen
tycho.andersen at canonical.com
Fri Jul 4 10:44:40 PDT 2014
On Fri, Jul 04, 2014 at 09:02:19PM +0400, Pavel Emelyanov wrote:
>
> >>> diff --git a/cgroup.c b/cgroup.c
> >>> index 1fe5e6d..306bfe3 100644
> >>> --- a/cgroup.c
> >>> +++ b/cgroup.c
> >>> @@ -18,7 +20,8 @@
> >>> /*
> >>> * This structure describes set of controller groups
> >>> * a task lives in. The cg_ctl entries are stored in
> >>> - * the @ctls list sorted by the .name field.
> >>> + * the @ctls list sorted by the .name field and then
> >>> + * by the .path field.
> >>
> >> Why do we need the .path sorting as well?
> >
> > I was thinking of the case when something is in both /lxc/u1 and /lxc,
> > if you visit /lxc/u1 first, it goes in heads and then /lxc does as
> > well. If we maintain this list as a sorted list, we will always visit
> > /lxc before /lxc/u1. This is why we still have the _MATCHing below as
> > well.
>
> OK, but the matching below scans the tree with ftw, which will always
> visit /lxc before /lxc/u1. Or am I missing something?
I was thinking that both /lxc and /lxc/u1 would be in the ctls list,
so it would traverse both of them explicitly with ftw; if it happens
to pick /lxc/u1 first, you get an incorrect tree.
Tycho
More information about the CRIU
mailing list