[Devel,1/2] spfs: pass both "mountpoint" and "ns_mountpoint" paths to manager

Submitted by Stanislav Kinsburskiy on June 9, 2017, 1:44 p.m.

Details

Message ID 20170609134423.863719.40596.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "spfs: update to work with CRIU v3"
Headers show

Commit Message

Stanislav Kinsburskiy June 9, 2017, 1:44 p.m.
Now, these two paths are different even for root mount namespace.
The first one (mountpoint) is the path, where the mount has to be mounted to
restore it.
The second one (ns_mountpoint) is the path, where mount will be located
_within__ container, and, thus, this pass has to be used to place real mount
to.
One more difference: "root" is not required anymore. Originally, path to mount
SPFS was constructed as follows:

SPFS_mnt_path = CT_root + mi->ns_mountpoint

Now mounts are created elsewhere and full path is defined in mi->mountpoint.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 criu/spfs.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/spfs.c b/criu/spfs.c
index f0c4da0..a5f6031 100644
--- a/criu/spfs.c
+++ b/criu/spfs.c
@@ -206,9 +206,11 @@  static int spfs_request_mount(int sock, struct mount_info *mi, const char *sourc
 		goto free_mountpoint;
 	}
 
-	mount = xsprintf("mount;id=%d;mode=restore;mountpoint=%s;"
-			 "ns_pid=%d;root=%s", mi->mnt_id,
-			 mountpoint, root_item->pid->real, opts.root);
+	mount = xsprintf("mount;id=%d;mode=restore;"
+			 "mountpoint=%s;ns_mountpoint=%s;"
+			 "ns_pid=%d", mi->mnt_id,
+			 mi->mountpoint, mi->ns_mountpoint,
+			 root_item->pid->real);
 	if (!mount) {
 		pr_err("failed to allocate mount request\n");
 		goto free_freeze_cgroup;