[CRIU] [PATCH 4/9] mount: save group and master in image file

Andrey Vagin avagin at openvz.org
Tue Jul 9 07:05:51 EDT 2013


They are required for restoring shared and slave mounts

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 1971c26..640cd12 100644
--- a/mount.c
+++ b/mount.c
@@ -461,6 +461,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.group		= pm->shared_id;
+	me.has_group		= true;
+	me.master		= pm->master_id;
+	me.has_master		= true;
 
 	if (!me.fstype && !is_root_mount(pm)) {
 		pr_err("FS mnt %s dev %#x root %s unsupported\n",
@@ -749,6 +753,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->group;
+		pm->master_id		= me->master;
 
 		/* FIXME: abort unsupported early */
 		pm->fstype		= decode_fstype(me->fstype);
diff --git a/protobuf/mnt.proto b/protobuf/mnt.proto
index 209c2ce..a63ac12 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		group			= 10;
+	optional uint32		master			= 11;
 }
-- 
1.8.3.1



More information about the CRIU mailing list