[Devel] [PATCH 7/7] spfs: switch mountsmode to STUB after root yard depopulation

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed Dec 20 19:07:21 MSK 2017


Otherwise CRIU stuck on SPFS mounts

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/cr-restore.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index eb9f50d..bd36523 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2253,12 +2253,6 @@ static int restore_root_task(struct pstree_item *init)
 	if (ret < 0)
 		goto out_kill;
 
-	if (spfs_is_running) {
-		ret = spfs_set_mode(spfs_sock, SPFS_MODE_STUB);
-		if (ret < 0)
-			goto out_kill;
-	}
-
 	if (fault_injected(FI_POST_RESTORE))
 		goto out_kill;
 
@@ -2279,6 +2273,12 @@ static int restore_root_task(struct pstree_item *init)
 
 	close_safe(&mnt_ns_fd);
 
+	if (spfs_is_running) {
+		ret = spfs_set_mode(spfs_sock, SPFS_MODE_STUB);
+		if (ret < 0)
+			goto out_kill;
+	}
+
 	if (write_restored_pid())
 		goto out_kill;
 



More information about the Devel mailing list