[CRIU] [RFC] mount: Print filesystem type for debug purpose

Cyrill Gorcunov gorcunov at openvz.org
Wed Nov 27 01:53:27 PST 2013


When we collect mountpoints we zap the filesystem type
reported by a kernel if we don't support it. Actually
it's quite usefull to know which real fs type was in
first place for debug purpose.

Thus the output will be something like

 | (00.004618)     type unsupported (ext4) source /dev/sda1 800001 / @ /boot flags 300000 options data=ordered,
 | (00.004660)     type unsupported (btrfs) source /dev/loop0 23 / @ /mnt/disk1 flags 300000 options space_cache,

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/proc_parse.h | 1 +
 proc_parse.c         | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/proc_parse.h b/include/proc_parse.h
index 553a8bbc02cc..f1ee8d10980e 100644
--- a/include/proc_parse.h
+++ b/include/proc_parse.h
@@ -107,6 +107,7 @@ struct mount_info {
 	int		master_id;
 	int		shared_id;
 	struct fstype	*fstype;
+	char		*__kfstype;	/* for debug print on collecting stage only */
 	char		*source;
 	char		*options;
 	bool		mounted;
diff --git a/proc_parse.c b/proc_parse.c
index d38d90e4823c..6bc5367cfca2 100644
--- a/proc_parse.c
+++ b/proc_parse.c
@@ -759,6 +759,7 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new)
 	if (ret != 3)
 		return -1;
 
+	new->__kfstype = strdup(fstype);
 	new->fstype = find_fstype_by_name(fstype);
 	free(fstype);
 
@@ -804,10 +805,12 @@ struct mount_info *parse_mountinfo(pid_t pid)
 			goto err;
 		}
 
-		pr_info("\ttype %s source %s %x %s @ %s flags %x options %s\n",
-				new->fstype->name, new->source,
+		pr_info("\ttype %s (%s) source %s %x %s @ %s flags %x options %s\n",
+				new->fstype->name, new->__kfstype, new->source,
 				new->s_dev, new->root, new->mountpoint,
 				new->flags, new->options);
+		xfree(new->__kfstype);
+		new->__kfstype = NULL;
 	}
 out:
 	fclose(f);
-- 
1.8.3.1



More information about the CRIU mailing list