diff options
author | David Teigland <teigland@redhat.com> | 2019-07-02 10:59:40 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2019-07-02 11:03:03 -0500 |
commit | f938545687accd8f451b1bde806484301e0ae086 (patch) | |
tree | 327616fc28289069f0fe06cee777cc018c562704 /tools/lvchange.c | |
parent | ba9d152aa5552f2b6d9ea3acf5ae644dc4dd1596 (diff) | |
download | lvm2-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.c | 8 |
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)) { |