[CRIU] [PATCH 02/10] mount: save group and master in image file (v2)

Andrey Vagin avagin at openvz.org
Tue Aug 13 09:02:45 EDT 2013


They are required for restoring shared and slave mounts

v2: use the same names of variables in image and in code
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c            | 6 ++++++
 protobuf/mnt.proto | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/mount.c b/mount.c
index b269449..dffd940 100644
--- a/mount.c
+++ b/mount.c
@@ -522,6 +522,10 @@ static int dump_one_mountpoint(struct mount_info *pm, int fd)
 	me.mountpoint		= pm->mountpoint;
 	me.source		= pm->source;
 	me.options		= pm->options;
+	me.shared_id		= pm->shared_id;
+	me.has_shared_id	= true;
+	me.master_id		= pm->master_id;
+	me.has_master_id	= true;
 
 	if (!me.fstype && !is_root_mount(pm)) {
 		pr_err("FS mnt %s dev %#x root %s unsupported\n",
@@ -809,6 +813,8 @@ static int populate_mnt_ns(int ns_pid)
 		pm->parent_mnt_id	= me->parent_mnt_id;
 		pm->s_dev		= me->root_dev;
 		pm->flags		= me->flags;
+		pm->shared_id		= me->shared_id;
+		pm->master_id		= me->master_id;
 
 		/* FIXME: abort unsupported early */
 		pm->fstype		= decode_fstype(me->fstype);
diff --git a/protobuf/mnt.proto b/protobuf/mnt.proto
index 209c2ce..ea1ad3c 100644
--- a/protobuf/mnt.proto
+++ b/protobuf/mnt.proto
@@ -20,4 +20,7 @@ message mnt_entry {
 	required string		mountpoint		= 7;
 	required string		source			= 8;
 	required string		options			= 9;
+
+	optional uint32		shared_id		= 10;
+	optional uint32		master_id		= 11;
 }
-- 
1.8.3.1



More information about the CRIU mailing list