From 143b8959c1aec8fc0b62330782f6b9148ec0692c Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 1 May 2015 14:56:33 +0200 Subject: [PATCH] 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 --- src/lxc/bdev.c | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.47.2