]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
overlay: create workdir if it doesn't exist
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 1 May 2015 12:56:33 +0000 (14:56 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 1 Jul 2015 15:53:08 +0000 (11:53 -0400)
Otherwise a container created before we needed workdir will fail
to start after a kernel+lxc update.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
src/lxc/bdev.c

index cf7c0432f540ae27ee36d8c23275265b954427ae..61bbe6d96a7babd464afc1942c9c38c440a6fa32 100644 (file)
@@ -2210,6 +2210,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