[CRIU] Re: [PATCH cr 4/4] restore: auto-unlink for ghost files (v2)

Pavel Emelyanov xemul at parallels.com
Tue Sep 11 10:01:00 EDT 2012


On 09/11/2012 12:11 AM, Andrey Vagin wrote:
> 
> A ghost file is used for restoring descriptors of an unlinked file.
> It is created, opened and deleted.
> 
> The previous scheme doesn't work, because ghost files are
> collected in a root task, but they are deleted from crtools.
> ghost_file_list is not shared, so ghost files are not deleted at all.
> 
> It was broken by the following commit:
> bd4e5d2f restore: prepare shared objects after initializing namespaces
> 
> We can't just move clear_ghost_files(), because we need to wait, until
> all processes have not opened a ghost file.
> We can add one more global barrier or move clear_ghost_files() in
> a restore code bellow an existent barrier.
> 
> Here is a better sollution, a gost file is deleted by the last user.
> 
> v2: Use the type atomic_t and fix a commit message.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-restore.c        |    6 ------
>  files-reg.c         |   37 +++++++++++++++++--------------------
>  include/files-reg.h |    3 ++-
>  3 files changed, 19 insertions(+), 27 deletions(-)
> 

All applied. Andrey, make patches against git.criu.org tree, not some yours
one. Patch #4 didn't apply in 2places, I had to fix it by hands :\


More information about the CRIU mailing list