Skip to contentSkip to conversation

master - lvconvert: support repair of cache/cachepool

PATCH Zdenek Kabelac 1 participant 1 message Sep 20, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a65649b45d0d0a417b64bf9918b2aeedb7f3993b
Commit:        a65649b45d0d0a417b64bf9918b2aeedb7f3993b
Parent:        aeb4f2bf3d25927e6cac2e37842498b207fefd1c
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Sep 18 11:33:47 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Sep 20 15:14:16 2017 +0200

lvconvert: support repair of cache/cachepool

Extend repair for cache and cachepool target
and user 'lvconvert_repair' routine name.

---
 WHATS_NEW              |    1 +
 tools/command-lines.in |   11 ++-
 tools/lvconvert.c      |  206 +++++++++++++++++++++++++++++++++++++++++++++---
 tools/lvmcmdline.c     |    4 +-
 tools/tools.h          |    2 +-
 5 files changed, 209 insertions(+), 15 deletions(-)
WHATS_NEW +1 -0
index e76214d..7927673 100644
@@ -1,5 +1,6 @@
 Version 2.02.175 - 
 ======================================
+  Support lvconvert --repair with cache and cachepool volumes.
   lvconvert --repair respects --poolmetadataspare option.
 
 Version 2.02.174 - 13th September 2017
tools/command-lines.in +9 -2
index e915483..ec02fa4 100644
@@ -658,17 +658,24 @@ FLAGS: SECONDARY_SYNTAX
 # lvconvert --repair-thinpool LV_thinpool
 # DESC: Repair a thin pool.
 #
+# lvconvert --repair-cache LV_cache
+# DESC: Repair a cache.
+#
+# lvconvert --repair-cachepool LV_cachepool
+# DESC: Repair a cachepool.
+#
 # lvm may want to do different things, or allow different options 
 # depending on which operation is being run, but as it stands, it
 # cannot do anything operation-specific until after the VG is read
 # and the LV type is known.
 
-lvconvert --repair LV_raid_mirror_thinpool
+lvconvert --repair LV_cache_cachepool_mirror_raid_thinpool
 OO: --usepolicies, --interval Number, --poolmetadataspare Bool, OO_LVCONVERT
 OP: PV ...
-ID: lvconvert_repair_pvs_or_thinpool
+ID: lvconvert_repair
 DESC: Replace failed PVs in a raid or mirror LV.
 DESC: Repair a thin pool.
+DESC: Repair a cache pool.
 RULE: all not lv_is_locked lv_is_pvmove
 RULE: --poolmetadataspare Bool and LV_cache LV_cachepool LV_thinpool
 
tools/lvconvert.c +196 -10

249 lines not on this page · raw message

tools/lvmcmdline.c +2 -2
index 55f72ac..fc4b3bb 100644
@@ -109,7 +109,7 @@ static const struct command_function command_functions[CMD_COUNT] = {
 	{ vgchange_systemid_CMD, vgchange_systemid_cmd },
 
 	/* lvconvert utilities related to repair. */
-	{ lvconvert_repair_pvs_or_thinpool_CMD,	lvconvert_repair_pvs_or_thinpool_cmd },
+	{ lvconvert_repair_CMD,	lvconvert_repair_cmd },
 	{ lvconvert_replace_pv_CMD, lvconvert_replace_pv_cmd },
 
 	/* lvconvert utilities related to snapshots. */
@@ -2877,7 +2877,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
 		lvmetad_make_unused(cmd);
 	}
 
-	if (cmd->command->command_enum == lvconvert_repair_pvs_or_thinpool_CMD) {
+	if (cmd->command->command_enum == lvconvert_repair_CMD) {
 		log_warn("WARNING: Disabling lvmetad cache for repair command.");
 		lvmetad_set_disabled(cmd, LVMETAD_DISABLE_REASON_REPAIR);
 		log_warn("WARNING: Not using lvmetad because of repair.");
tools/tools.h +1 -1
index ba4edeb..53f8ddc 100644
@@ -240,7 +240,7 @@ int lvchange_rebuild_cmd(struct cmd_context *cmd, int argc, char **argv);
 int lvchange_monitor_poll_cmd(struct cmd_context *cmd, int argc, char **argv);
 int lvchange_persistent_cmd(struct cmd_context *cmd, int argc, char **argv);
 
-int lvconvert_repair_pvs_or_thinpool_cmd(struct cmd_context *cmd, int argc, char **argv);
+int lvconvert_repair_cmd(struct cmd_context *cmd, int argc, char **argv);
 int lvconvert_replace_pv_cmd(struct cmd_context *cmd, int argc, char **argv);
 
 int lvconvert_merge_snapshot_cmd(struct cmd_context *cmd, int argc, char **argv);