]> 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>
Fri, 14 Aug 2015 17:07:25 +0000 (13:07 -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 13d076be1e3670aeaec23461306c6fc7fcd5aaa1..984690a0a2e42daec3547dd73e3ea6d6007d8c51 100644 (file)
@@ -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