[lxc-devel] [PATCH] overlayfs_mount: create delta dir if it doesn't exist

Stéphane Graber stgraber at ubuntu.com
Mon Sep 21 17:24:47 UTC 2015


On Mon, Sep 21, 2015 at 05:09:25PM +0000, Serge Hallyn wrote:
> (This *should* fix the lxc-test-snapshot testcase, but doesn't seem
> to by itself.)
> 
> If it doesn't exist, we may as well start with an empty one.  This
> is needed when creating an overlayfs snapshot.
> 
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  src/lxc/bdev.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
> index 64e8832..b81827e 100644
> --- a/src/lxc/bdev.c
> +++ b/src/lxc/bdev.c
> @@ -2224,6 +2224,10 @@ static int overlayfs_mount(struct bdev *bdev)
>  	*upper = '\0';
>  	upper++;
>  
> +	// if delta doesn't yet exist, create it
> +	if (mkdir_p(upper, 0755) < 0 && errno != EEXIST)
> +		return -22;
> +
>  	// overlayfs.v22 or higher needs workdir option
>  	// if upper is /var/lib/lxc/c2/delta0,
>  	// then workdir is /var/lib/lxc/c2/olwork
> -- 
> 2.5.0
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150921/57595a6d/attachment.sig>


More information about the lxc-devel mailing list