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

Andrey Vagin avagin at openvz.org
Mon Sep 10 16:11:12 EDT 2012


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(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-restore-auto-unlink-for-ghost-files-v2.patch
Type: text/x-patch
Size: 3265 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20120911/3b7d5add/0004-restore-auto-unlink-for-ghost-files-v2.bin


More information about the CRIU mailing list