Unverified Commit d848b631 by Christian Brauner Committed by Stéphane Graber

btrfs: only chown_mapped_root() if not btrfs

parent 8e295bc1
......@@ -412,12 +412,17 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
goto err;
}
if (!strcmp(new->type, "overlay") || !strcmp(new->type, "overlayfs"))
src_no_prefix = ovl_get_lower(new->src);
else
src_no_prefix = lxc_storage_get_path(new->src, new->type);
if (am_unpriv() && chown_mapped_root(src_no_prefix, c0->lxc_conf) < 0)
WARN("Failed to update ownership of %s", new->dest);
/* If the storage driver is "btrfs" then the we will create snapshot. */
if (strcmp(bdevtype, "btrfs")) {
if (!strcmp(new->type, "overlay") ||
!strcmp(new->type, "overlayfs"))
src_no_prefix = ovl_get_lower(new->src);
else
src_no_prefix = lxc_storage_get_path(new->src, new->type);
if (am_unpriv() && chown_mapped_root(src_no_prefix, c0->lxc_conf) < 0)
WARN("Failed to chown \"%s\"", src_no_prefix);
}
if (snap)
return new;
......
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