[CRIU] [PATCH cr 09/10] restore: fail restore if pgid or sid are not restored

Andrey Vagin avagin at openvz.org
Tue Jun 19 08:47:00 EDT 2012


Don't fail if a root non-init task has another sid, because
it's inherited from parent and can't be restored and
it's expected behaviour, when a subtree is dumped.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index af03801..f636f87 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -713,7 +713,7 @@ static void sigchld_handler(int signal, siginfo_t *siginfo, void *data)
 
 static void xid_fail(void)
 {
-	/* exit(1) */
+	exit(1);
 }
 
 static void restore_sid(void)
@@ -739,6 +739,9 @@ static void restore_sid(void)
 	} else {
 		sid = getsid(getppid());
 		if (sid != me->sid) {
+			/* Skip the root task if it's not init */
+			if (me == root_item && root_item->pid != 1)
+				return;
 			pr_err("Requested sid %d doesn't match inherited %d\n",
 					me->sid, sid);
 			xid_fail();
-- 
1.7.1



More information about the CRIU mailing list