[CRIU] [PATCH 15/37] files: save mnt_id for reg files

Andrey Vagin avagin at openvz.org
Fri Apr 18 07:42:53 PDT 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 files-reg.c            | 6 ++++++
 protobuf/regfile.proto | 1 +
 2 files changed, 7 insertions(+)

diff --git a/files-reg.c b/files-reg.c
index 5b6c4a3..3d316ec 100644
--- a/files-reg.c
+++ b/files-reg.c
@@ -22,6 +22,7 @@
 #include "util.h"
 #include "fs-magic.h"
 #include "asm/atomic.h"
+#include "namespaces.h"
 
 #include "protobuf.h"
 #include "protobuf/regfile.pb-c.h"
@@ -557,6 +558,11 @@ int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
 	} else
 		link = p->link;
 
+	if (p->mnt_id >= 0 && (root_ns_mask & CLONE_NEWNS)) {
+		rfe.mnt_id = p->mnt_id;
+		rfe.has_mnt_id = true;
+	}
+
 	pr_info("Dumping path for %d fd via self %d [%s]\n",
 			p->fd, lfd, &link->name[1]);
 
diff --git a/protobuf/regfile.proto b/protobuf/regfile.proto
index d975ab0..e91dc44 100644
--- a/protobuf/regfile.proto
+++ b/protobuf/regfile.proto
@@ -6,4 +6,5 @@ message reg_file_entry {
 	required uint64		pos	= 3;
 	required fown_entry	fown	= 5;
 	required string		name	= 6;
+	optional sint32		mnt_id	= 7 [default = -1];
 }
-- 
1.8.5.3



More information about the CRIU mailing list