From: Serge Hallyn Date: Fri, 1 May 2015 12:56:33 +0000 (+0200) Subject: overlay: create workdir if it doesn't exist X-Git-Tag: lxc-1.0.8~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=143b8959c1aec8fc0b62330782f6b9148ec0692c;p=thirdparty%2Flxc.git overlay: create workdir if it doesn't exist Otherwise a container created before we needed workdir will fail to start after a kernel+lxc update. Signed-off-by: Serge Hallyn Acked-by: KATOH Yasufumi --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 13d076be1..984690a0a 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -2219,6 +2219,11 @@ static int overlayfs_mount(struct bdev *bdev) return -22; } + if (mkdir_p(work, 0755) < 0 && errno != EEXIST) { + free(mntdata); + return -22; + } + // TODO We should check whether bdev->src is a blockdev, and if so // but for now, only support overlays of a basic directory