From 92c0e8c17f506b551c1b7c0a448d60279e7fdae6 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 28 Sep 2020 19:17:54 +0200 Subject: [PATCH] writecache: archive before modification of metadata Archive before we start to modify metadata. --- lib/metadata/lv_manip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 793a86d1f..6a89f1ec0 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -6506,6 +6506,9 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, return 0; } + if (!archive(vg)) + return_0; + if (!lv_detach_writecache_cachevol(lv, 1)) { log_error("Failed to detach writecache from %s", display_lvname(lv)); return 0; -- 2.43.5