summaryrefslogtreecommitdiff
path: root/tools/lvchange.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2019-07-02 10:59:40 -0500
committerDavid Teigland <teigland@redhat.com>2019-07-02 11:03:03 -0500
commitf938545687accd8f451b1bde806484301e0ae086 (patch)
tree327616fc28289069f0fe06cee777cc018c562704 /tools/lvchange.c
parentba9d152aa5552f2b6d9ea3acf5ae644dc4dd1596 (diff)
downloadlvm2-f938545687accd8f451b1bde806484301e0ae086.tar.gz
cache: warn and prompt for writeback with cachevol
The cache repair utility does not yet work with a cachevol (where metadata and data exist on the same LV.) So, warn and prompt if writeback is specified with a cachevol.
Diffstat (limited to 'tools/lvchange.c')
-rw-r--r--tools/lvchange.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c
index e7fb57d1d..c28a7bb9c 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -635,6 +635,14 @@ static int _lvchange_cache(struct cmd_context *cmd,
if (!get_cache_params(cmd, &chunk_size, &format, &mode, &name, &settings))
goto_out;
+ if (seg_is_cache(seg) && lv_is_cache_vol(seg->pool_lv) && (mode == CACHE_MODE_WRITEBACK)) {
+ log_warn("WARNING: repairing a damaged cachevol is not yet possible.");
+ log_warn("WARNING: cache mode writethrough is suggested for safe operation.");
+ if (!arg_count(cmd, yes_ARG) &&
+ yes_no_prompt("Continue using writeback without repair?") == 'n')
+ goto_out;
+ }
+
if ((mode != CACHE_MODE_UNSELECTED) &&
(mode != setting_seg->cache_mode) &&
lv_is_cache(lv)) {