Skip to contentSkip to conversation

master - thin: lvextend will fail is autoextend is 0%

PATCH Zdenek Kabelac 1 participant 1 message Oct 14, 2012

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=16060b101bdb541376fdfd7c0e6cac8cf73c0271
Commit:        16060b101bdb541376fdfd7c0e6cac8cf73c0271
Parent:        a6f53b5c0d2a23f73af7d4a2778dfc0da4da0944
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Oct 14 19:43:25 2012 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sun Oct 14 23:17:30 2012 +0200

thin: lvextend will fail is autoextend is 0%

Since extending by 0% will not increase the size of pool, return failure.

---
 WHATS_NEW        |    1 +
 tools/lvresize.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
index a170bfe..d60cad5 100644
@@ -1,5 +1,6 @@
 Version 2.02.98 -
 =================================
+  Using autoextend percent 0 for thin pool fails 'lvextend --use-policies'.
   Introduce blkdeactivate script.
   Implement devices/global_filter (affects lvmetad).
   Make vgscan --cache an alias to pvscan --cache.
tools/lvresize.c +2 -0
index 18e5917..4c9580d 100644
@@ -293,6 +293,8 @@ static int _adjust_policy_params(struct cmd_context *cmd,
 		policy_amount =
 			find_config_tree_int(cmd, "activation/thin_pool_autoextend_percent",
 					     DEFAULT_THIN_POOL_AUTOEXTEND_PERCENT);
+		if (!policy_amount && policy_threshold < PERCENT_100)
+                        return 0;
 	} else {
 		policy_threshold =
 			find_config_tree_int(cmd, "activation/snapshot_autoextend_threshold",