[CRIU] OverlayFS Patch

Pavel Emelyanov xemul at parallels.com
Thu Aug 6 02:14:02 PDT 2015


On 08/06/2015 02:21 AM, Gabriel Guimaraes wrote:
> So I just tested it and it turns out that, because of the Kernel bug, statfs returns ext2/ext3 instead 
> of OVERLAYFS_MAGIC when used on a symlink to a file in an OVFs directory, so we can't rely on that.

I see :) Yet another patch idea for the kernel.

> The following patch enables opts.overlayfs = true in main and makes sure that we only call
> __mntns_get_root_fd and fstatat if there is an OverlayFS mounted directory in the mountinfo table.
> Pavel, if you want we can remove opts.overlayfs altogether.
> 
> Let me know what you think!

Everything is OK, please add one hunk fixing the below thing

> @@ -254,6 +255,7 @@ int main(int argc, char *argv[], char *envp[])
>  	if (init_service_fd())
>  		return 1;
>  
> +	opts.overlayfs = true;
>  	if (!strcmp(argv[1], "swrk")) {
>  		/*
>  		 * This is to start criu service worker from libcriu calls.

Let's keep this false by default and set it to true here:

> @@ -1365,6 +1448,9 @@ static struct fstype fstypes[32] = {
>  		.code = FSTYPE__FUSE,
>  		.dump = always_fail,
>  		.restore = always_fail,
> +	}, {
> +		.name = "overlay",
> +		.code = FSTYPE__OVERLAYFS,
>  	},
>  };
>  

Add the ->parse callback to "overlay" type just like the aufs' one:
in proc_pase.c aufs_parse() does exactly this.

-- Pavel


More information about the CRIU mailing list