[CRIU] [PATCH 3/8] ghosts: Add comment about shared path allocation

Pavel Emelyanov xemul at virtuozzo.com
Thu May 18 02:35:48 PDT 2017


Ghost remaps allocate path with shmalloc. Add comment
why this is such.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/files-reg.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/criu/files-reg.c b/criu/files-reg.c
index 5456614..d5e22af 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -259,6 +259,13 @@ static int collect_remap_ghost(struct reg_file_info *rfi,
 	if (!gf)
 		return -1;
 
+	/*
+	 * The rpath is shmalloc-ed because we create the ghost
+	 * file in root task context and generate its path there.
+	 * However the path should be visible by the criu task
+	 * in order to remove the ghost files from root FS (see
+	 * try_clean_remaps()).
+	 */
 	gf->remap.rpath = shmalloc(PATH_MAX);
 	if (!gf->remap.rpath)
 		return -1;
-- 
2.1.4



More information about the CRIU mailing list