summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-11-19 13:32:03 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2015-11-19 14:40:24 +0100
commit795616a87bbb5fd2a3925e1445bb1a94ce718d55 (patch)
treefca9db0d4702162fb90c397d7f35534481cd1685
parentd1608345dffd912dd591d71a147c5acf587cf7fe (diff)
downloadlvm2-795616a87bbb5fd2a3925e1445bb1a94ce718d55.tar.gz
cache: lvconvert repairs only thin pools
Avoid internal error message where thin pool repair code tries to fix cache pool - was catched later in code stack, so rather catch this early and make the repair function exlusive to thin pools. So far we have no code for repairing cache pools (other then the automatic during activation/deactivation).
-rw-r--r--WHATS_NEW1
-rw-r--r--tools/lvconvert.c13
2 files changed, 10 insertions, 4 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 0519527a9..b0e79c820 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.135 -
====================================
+ Show correct error message for unsupported yet cache pool repair.
Allow lvconvert cache pools' data and metadata LV to raid.
Fix reading of old metadata with missing cache policy or mode settings.
Issue error if external_device_info_source=udev and udev db record incomplete.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 19ee60754..72be45b45 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2320,9 +2320,9 @@ out:
return r;
}
-static int _lvconvert_pool_repair(struct cmd_context *cmd,
- struct logical_volume *pool_lv,
- struct lvconvert_params *lp)
+static int _lvconvert_thin_pool_repair(struct cmd_context *cmd,
+ struct logical_volume *pool_lv,
+ struct lvconvert_params *lp)
{
const char *dmdir = dm_dir();
const char *thin_dump =
@@ -3270,7 +3270,12 @@ static int _lvconvert_single(struct cmd_context *cmd, struct logical_volume *lv,
if (arg_count(cmd, repair_ARG)) {
if (lv_is_pool(lv)) {
- if (!_lvconvert_pool_repair(cmd, lv, lp))
+ if (lv_is_cache_pool(lv)) {
+ log_error("Repair for cache pool %s not yet implemented.",
+ display_lvname(lv));
+ return ECMD_FAILED;
+ }
+ if (!_lvconvert_thin_pool_repair(cmd, lv, lp))
return_ECMD_FAILED;
return ECMD_PROCESSED;
}