From 23e092f7090820d02b2ca2de1b0b83376a00548a Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 18 May 2017 12:35:48 +0300 Subject: [PATCH] ghosts: Add comment about shared path allocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ghost remaps allocate path with shmalloc. Add comment why this is such. ✓ travis-ci: success for Sanitize initialization bits Signed-off-by: Pavel Emelyanov --- criu/files-reg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/criu/files-reg.c b/criu/files-reg.c index 9c0a0a22f..3d03cd5e9 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;