[CRIU] [RFC PATCH 3/6] introduce mnt_entry->fsname for FSTYPE__AUTO filesystems

Oleg Nesterov oleg at redhat.com
Fri Mar 27 10:55:50 PDT 2015


A separate change for documentation purposes.

This patch adds mnt_entry->fsname to dump/restore the ->fsname of the
FSTYPE__AUTO filesystems. This is ugly, we need to dump and restore
the list of FSTYPE__AUTO names once, but I do not know how to do this
because I do not understand protobufs.

Help!

Signed-off-by: Oleg Nesterov <oleg at redhat.com>
---
 mount.c            |   20 ++++++++++++++++++++
 protobuf/mnt.proto |    2 ++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/mount.c b/mount.c
index 52156d6..e05b599 100644
--- a/mount.c
+++ b/mount.c
@@ -1160,6 +1160,9 @@ static int dump_one_mountpoint(struct mount_info *pm, struct cr_img *img)
 
 	me.fstype		= pm->fstype->code;
 
+	if (me.fstype == FSTYPE__AUTO)
+		me.fsname = pm->fstype->name;
+
 	if (pm->parent && !pm->dumped && !pm->need_plugin &&
 	    pm->fstype->dump && fsroot_mounted(pm)) {
 		struct mount_info *t;
@@ -1881,6 +1884,23 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
 		pm->need_plugin		= me->with_plugin;
 		pm->is_ns_root		= is_root(me->mountpoint);
 
+		BUG_ON((me->fstype == FSTYPE__AUTO) !=
+		       (me->fsname != NULL));
+
+		if (me->fstype == FSTYPE__AUTO) {
+			/*
+			 * TODO: this is ugly and suboptimal. We should dump
+			 * the list of FSTYPE__AUTO fsnames and restore them
+			 * all once
+			 */
+
+			/*
+			 * XXX: just print the dumped/restored ->fsname till
+			 * the next patch.
+			 */
+			pr_warn("XXX FSTYPE__AUTO name:[%s]\n", me->fsname);
+		}
+
 		/* FIXME: abort unsupported early */
 		pm->fstype		= decode_fstype(me->fstype);
 
diff --git a/protobuf/mnt.proto b/protobuf/mnt.proto
index 9bb920d..8afb976 100644
--- a/protobuf/mnt.proto
+++ b/protobuf/mnt.proto
@@ -36,4 +36,6 @@ message mnt_entry {
 
 	optional bool		with_plugin		= 12;
 	optional bool		ext_mount		= 13;
+
+	optional string		fsname			= 14;
 }
-- 
1.5.5.1



More information about the CRIU mailing list