[CRIU] Re: [PATCH 2/4] restore: Add checkpoint/restore for /proc/pid/exe symlink

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 7 09:59:17 EST 2012


On Tue, Feb 07, 2012 at 04:24:35PM +0400, Pavel Emelyanov wrote:
> On 02/07/2012 04:22 PM, Cyrill Gorcunov wrote:
> > On Tue, Feb 07, 2012 at 04:17:08PM +0400, Pavel Emelyanov wrote:
> >>> @@ -230,6 +231,16 @@ static int restore_cwd(struct fdinfo_entry *fe, int fd)
> >>>  	return 0;
> >>>  }
> >>>  
> >>> +static int restore_exe_early(struct fdinfo_entry *fe, int fd)
> >>> +{
> >>> +	char path[PATH_MAX];
> >>> +
> >>> +	if (get_file_path(path, fe, fd))
> >>> +		return -1;
> >>> +
> >>> +	pr_info("Skips restoring EXE (%s) symlink at this stage\n", path);
> >>> +	return 0;
> >>
> >> What is this function for?
> >>
> > 
> > It's informative message, we can live without it but note that we have
> > to skip EXE name in image, so if we drop this function we need to do
> > lseek somewhere else in code and skip the name of exe link in image
> > reading procedure.
> 
> Just place a comment here, saying that the restore is done later, in function
> called "xxx", so we just skip it, and call lseek(fd, fe->len);
> 

Pavel, I've made a commit on top of all series, would it be enough
to accept it?

	Cyrill
---
From: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Tue, 7 Feb 2012 18:55:22 +0400
Subject: [PATCH] restore: Drop unneeded message about deferred EXE symlink restoration

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 files.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/files.c b/files.c
index 7c9ceb3..94d760e 100644
--- a/files.c
+++ b/files.c
@@ -233,12 +233,12 @@ static int restore_cwd(struct fdinfo_entry *fe, int fd)
 
 static int restore_exe_early(struct fdinfo_entry *fe, int fd)
 {
-	char path[PATH_MAX];
-
-	if (get_file_path(path, fe, fd))
-		return -1;
-
-	pr_info("Skips restoring EXE (%s) symlink at this stage\n", path);
+	/*
+	 * We restore the EXE symlink at very late stage
+	 * because of restrictions applied from kernel side,
+	 * so simply skip it for a while.
+	 */
+	lseek(fd, fe->len, SEEK_CUR);
 	return 0;
 }
 
-- 
1.7.7.6



More information about the CRIU mailing list