Skip to contentSkip to conversation

master - thin: deactivate subvolumes

PATCH Zdenek Kabelac 1 participant 1 message Dec 2, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ade2f47829f66d061d69844b9911e266751435b7
Commit:        ade2f47829f66d061d69844b9911e266751435b7
Parent:        dde5a6c52b315d7b8e2dd6b91e17eb3955534682
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Dec 2 16:31:27 2012 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sun Dec 2 17:56:44 2012 +0100

thin: deactivate subvolumes

Do not leave active thin data and metadata volumes if activation of thin pool fails.

---
 tools/lvconvert.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
tools/lvconvert.c +5 -0
index a75a7fc..2ef8d86 100644
@@ -1960,6 +1960,11 @@ static int _lvconvert_thinpool(struct cmd_context *cmd,
 	if (!activate_lv_excl(cmd, pool_lv)) {
 		log_error("Failed to activate pool logical volume %s/%s.",
 			  pool_lv->vg->name, pool_lv->name);
+		/* Deactivate subvolumes */
+		if (!deactivate_lv(cmd, seg_lv(seg, 0)))
+			log_error("Failed to deactivate pool data logical volume.");
+		if (!deactivate_lv(cmd, seg->metadata_lv))
+			log_error("Failed to deactivate pool metadata logical volume.");
 		goto out;
 	}