summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-08-25 14:48:31 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-08-26 11:24:41 +0200
commit9886fd236e2cf09f299589e0e2b6cb7454b2314a (patch)
treed47f4aac52f2b756d617485cfd654e0481f7ccbb
parenta4fdfc098d7a1c28793a8ba6f82277ecef40dfcd (diff)
downloadlvm2-9886fd236e2cf09f299589e0e2b6cb7454b2314a.tar.gz
cache: lvconvert accepts --cachemode for --cache
All cache args could be specified when caching LV (means converting LV to cached). When --cachemode arg is given during cache-pool conversion, store it in the metadata. https://bugzilla.redhat.com/show_bug.cgi?id=1255184
-rw-r--r--WHATS_NEW1
-rw-r--r--tools/lvconvert.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index ac8e1e96e..ea50997ee 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.129 -
===================================
+ Accept --cachemode with lvconvert.
Fix and improve reporting properties of cache-pool.
Enable usage of --cachepolicy and --cachesetting with lvconvert.
Don't allow to reduce size of thin-pool metadata.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 95996b7fd..07d9f437b 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2828,7 +2828,7 @@ static int _lvconvert_pool(struct cmd_context *cmd,
if (!metadata_lv) {
if (arg_from_list_is_set(cmd, "is invalid with existing pool",
- cachemode_ARG, chunksize_ARG, discards_ARG,
+ chunksize_ARG, discards_ARG,
zero_ARG, poolmetadatasize_ARG, -1))
return_0;
@@ -3069,6 +3069,10 @@ mda_write:
seg->discards = lp->discards;
seg->zero_new_blocks = lp->zero ? 1 : 0;
+ if (lp->cache_mode &&
+ !cache_set_mode(seg, lp->cache_mode))
+ return_0;
+
if ((lp->policy_name || lp->policy_settings) &&
!cache_set_policy(seg, lp->policy_name, lp->policy_settings))
return_0;