Commit 6d5b330d by Tycho Andersen Committed by Stéphane Graber

Exit on errors in restore()'s worker

If we just return here, we end up with two processes executing the caller's code, which is not good. Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 5f845c92
...@@ -3830,7 +3830,7 @@ static bool lxcapi_restore(struct lxc_container *c, char *directory, bool verbos ...@@ -3830,7 +3830,7 @@ static bool lxcapi_restore(struct lxc_container *c, char *directory, bool verbos
struct criu_opts os; struct criu_opts os;
if (unshare(CLONE_NEWNS)) if (unshare(CLONE_NEWNS))
return false; exit(1);
/* CRIU needs the lxc root bind mounted so that it is the root of some /* CRIU needs the lxc root bind mounted so that it is the root of some
* mount. */ * mount. */
...@@ -3838,15 +3838,15 @@ static bool lxcapi_restore(struct lxc_container *c, char *directory, bool verbos ...@@ -3838,15 +3838,15 @@ static bool lxcapi_restore(struct lxc_container *c, char *directory, bool verbos
if (rootfs_is_blockdev(c->lxc_conf)) { if (rootfs_is_blockdev(c->lxc_conf)) {
if (do_rootfs_setup(c->lxc_conf, c->name, c->config_path) < 0) if (do_rootfs_setup(c->lxc_conf, c->name, c->config_path) < 0)
return false; exit(1);
} }
else { else {
if (mkdir(rootfs->mount, 0755) < 0 && errno != EEXIST) if (mkdir(rootfs->mount, 0755) < 0 && errno != EEXIST)
return false; exit(1);
if (mount(rootfs->path, rootfs->mount, NULL, MS_BIND, NULL) < 0) { if (mount(rootfs->path, rootfs->mount, NULL, MS_BIND, NULL) < 0) {
rmdir(rootfs->mount); rmdir(rootfs->mount);
return false; exit(1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment