Skip to contentSkip to conversation

master - thin: support lvchange for data and metadata

PATCH Zdenek Kabelac 1 participant 1 message Aug 26, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6b416f837f4ee71ca5705cb40fad22b26b0c664a
Commit:        6b416f837f4ee71ca5705cb40fad22b26b0c664a
Parent:        7d6a125e97085ea140c582a0b6c1ef2ca4cb0f93
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat Aug 10 01:13:27 2013 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Aug 26 14:55:22 2013 +0200

thin: support lvchange for data and metadata

Support lvchange operation on stacked thin pool data and metadata volumes.

---
 WHATS_NEW        |    1 +
 tools/lvchange.c |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index 3ea8786..bf13023 100644
@@ -1,5 +1,6 @@
 Version 2.02.101 - 
 ===================================
+  Support most of lvchange operations on stacked thin pool meta/data LVs.
   Add ability to pvmove RAID, mirror, and thin volumes.
   Make lvm2-activation-generator silent unless it's in error state.
   Remove "mpath major is not dm major" msg for mpath component scan (2.02.94).
tools/lvchange.c +7 -1
index 525022f..34e230c 100644
@@ -982,7 +982,13 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
 	    lv_is_virtual_origin(origin = origin_from_cow(lv)))
 		lv = origin;
 
-	if (!(lv_is_visible(lv)) && !lv_is_virtual_origin(lv)) {
+	if ((lv_is_thin_pool_data(lv) || lv_is_thin_pool_metadata(lv)) &&
+	    !arg_count(cmd, activate_ARG) &&
+	    !arg_count(cmd, permission_ARG) &&
+	    !arg_count(cmd, setactivationskip_ARG))
+	    /* Rest can be changed for stacked thin pool meta/data volumes */
+	    ;
+	else if (!(lv_is_visible(lv)) && !lv_is_virtual_origin(lv)) {
 		log_error("Unable to change internal LV %s directly",
 			  lv->name);
 		return ECMD_FAILED;