• Andrew Vagin's avatar
    mnt: clean up a root yard after openning all files · 10af342f
    Andrew Vagin authored
    The root yard is used to clean up ghost files.
    
    Now try_clean_remaps() is called from depopulate_roots_yard(), so
    the code about switching mount namespaces was moved to
    depopulate_roots_yard().
    
    v2: call clean_remaps() when processes are restored in
        the host mount namespace.
    
    Now depopulate_roots_yard() is called from the root task before
    finishing CR_STATE_FORKING.
    
    I moved it to the criu process and do it after clean_remaps(), because
    clean_remaps() uses the roots yard.
    
    It's called after openning all files, because only at this moment we can
    be sure that all link remap files can be removed.
    
    restore_task_with_children()		| restore_root_task()
    -----------------------------------------------------------------------
    depopulate_roots_yard()			|
    restore_finish_stage(CR_STATE_FORKING)	|
    prepare_fds()				|
    open_vmas()				|
    					| restore_switch_stage(CR_STATE_RESTORE_SIGCHLD)
    					| clean_remaps = 0;
    
    If something fails between CR_STATE_FORKING and CR_STATE_RESTORE_SIGCHLD,
    try_clean_remaps will be called().
    
    try_clean_remaps()
      try_clean_ghost()
        rst_get_mnt_root()
          print_ns_root()
    	snprintf(buf, bs, "%s/%d", mnt_roots, ns->id);
    
    it uses mnt_roots, actually it is what we called the roots yard.
    Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    10af342f
files-reg.h 1.57 KB