From: KATOH Yasufumi Date: Wed, 4 Mar 2015 09:39:14 +0000 (+0900) Subject: Use rdepends when non-thinpool LVM container is cloned X-Git-Tag: lxc-1.1.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b9a014a6e430dadb3422b6951a4af376ce6410d;p=thirdparty%2Flxc.git Use rdepends when non-thinpool LVM container is cloned 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 Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 197ab55e9..cf7c0432f 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -3403,8 +3403,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) {