]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Use rdepends when non-thinpool LVM container is cloned
authorKATOH Yasufumi <karma@jazz.email.ne.jp>
Wed, 4 Mar 2015 09:39:14 +0000 (18:39 +0900)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 16:45:48 +0000 (12:45 -0400)
When a non-thinpool LVM container which have snapshotted clone is
destroyed, the LV of snapshotted clone was also deleted. This patch
prevent it.

The original non-thinpool LVM container of snapshotted clone cannot be
now destroyed.

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

index 5d035ae99253d59769f811c4ca6a17e2fda36146..13d076be1e3670aeaec23461306c6fc7fcd5aaa1 100644 (file)
@@ -3100,8 +3100,12 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
        *needs_rdep = 0;
        if (bdevtype && strcmp(orig->type, "dir") == 0 &&
                        (strcmp(bdevtype, "aufs") == 0 ||
-                        strcmp(bdevtype, "overlayfs") == 0))
+                        strcmp(bdevtype, "overlayfs") == 0)) {
                *needs_rdep = 1;
+       } else if (snap && strcmp(orig->type, "lvm") == 0 &&
+                       !lvm_is_thin_volume(orig->src)) {
+               *needs_rdep = 1;
+       }
 
        new = bdev_get(bdevtype ? bdevtype : orig->type);
        if (!new) {