[CRIU] [PATCH] Allow dumping of pstore, securityfs, fusectl, debugfs

Pavel Emelyanov xemul at parallels.com
Mon Jun 9 09:25:39 PDT 2014


On 06/09/2014 08:04 PM, Tycho Andersen wrote:
> These are mounted by default in ubuntu containers, so criu should know about
> them and remount them on restore.

The Signed-off-by: line is missing.

> ---
>  mount.c            | 28 ++++++++++++++++++++++++++++
>  protobuf/mnt.proto |  4 ++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/mount.c b/mount.c
> index d770e14..5415236 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -706,6 +706,18 @@ out:
>  	return ret;
>  }
>  
> +#define MK_MOUNT_LOG(IMG_TYPE, FNAME) 					\
> +	static int FNAME##_dump(struct mount_info *pm) 			\
> +	{								\
> +		pr_info("logging mount of %s\n", pm->fstype->name);	\
> +		return 0;						\
> +	}
> +
> +MK_MOUNT_LOG(CR_FD_PSTORE_IMG, pstore)
> +MK_MOUNT_LOG(CR_FD_SECURITYFS_IMG, securityfs)
> +MK_MOUNT_LOG(CR_FD_FUSECTL_IMG, fusectl)
> +MK_MOUNT_LOG(CR_FD_DEBUGFS_IMG, debugfs)

I think it's OK just to put this logging right into the dump_one_mountpoint.

> +
>  static struct fstype fstypes[] = {
>  	{
>  		.name = "unsupported",
> @@ -738,6 +750,22 @@ static struct fstype fstypes[] = {
>  	}, {
>  		.name = "btrfs",
>  		.code = FSTYPE__UNSUPPORTED,
> +	}, {
> +		.name = "pstore",
> +		.dump = pstore_dump,
> +		.code = FSTYPE__PSTORE,

I haven't worked with pstore, thus the question -- what if we
just umount it on one box and mount on another without doing
anything about preserving its contents. Will it affect the container?

> +	}, {
> +		.name = "securityfs",
> +		.dump = securityfs_dump,
> +		.code = FSTYPE__SECURITYFS,

Same question here.

> +	}, {
> +		.name = "fusectl",
> +		.dump = fusectl_dump,
> +		.code = FSTYPE__FUSECTL,

But not here -- since fusectl is "read-only" FS and its contents
depends on "fuse" mounts, we can just dump the mountpoint. If there
are "fuse" mounts in container, we will fail on dumping _them_.

> +	}, {
> +		.name = "debugfs",
> +		.dump = debugfs_dump,
> +		.code = FSTYPE__DEBUGFS,

This makes me worry. AFAIK we can modify the contents of this FS,
and if we just umount and mount it we'll lose the contents.

>  	}
>  };
>  
> diff --git a/protobuf/mnt.proto b/protobuf/mnt.proto
> index ab85de7..297bcbd 100644
> --- a/protobuf/mnt.proto
> +++ b/protobuf/mnt.proto
> @@ -7,6 +7,10 @@ enum fstype {
>  	TMPFS			= 5;
>  	DEVPTS			= 6;
>  	SIMFS			= 7;
> +	PSTORE			= 8;
> +	SECURITYFS		= 9;
> +	FUSECTL			= 10;
> +	DEBUGFS			= 11;
>  };
>  
>  message mnt_entry {
> 




More information about the CRIU mailing list