]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Revert "btrfs: only chown_mapped_root() if not btrfs"
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 15 Aug 2017 16:12:58 +0000 (18:12 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 15 Aug 2017 16:45:04 +0000 (18:45 +0200)
This reverts commit d848b631492434985ffc5de9bbd7c631101077cb.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/bdev/bdev.c

index 303821cb4b611f5267369a80aea9de0700f0ed74..3a67997a8e4b0a31e676a1a965ea51c2a1e16a26 100644 (file)
@@ -412,17 +412,12 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
                goto err;
        }
 
-       /* 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 (!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 (snap)
                return new;