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

Submitted by Stanislav Kinsburskiy on Dec. 20, 2017, 4:07 p.m.

Details

Message ID 20171220160721.957380.26525.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "spfs: duplicate socket before sending it from usernsd"
Headers show

Commit Message

Stanislav Kinsburskiy Dec. 20, 2017, 4:07 p.m.
Otherwise CRIU stuck on SPFS mounts

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

Patch hide | download patch | download mbox

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;