Blame SOURCES/lvm2-2_03_12-writecache-use-cleaner-message-instead-of-table-relo.patch

abb29f
 lib/metadata/writecache_manip.c | 10 +++++++---
abb29f
 tools/lvconvert.c               |  2 ++
abb29f
 2 files changed, 9 insertions(+), 3 deletions(-)
abb29f
abb29f
diff --git a/lib/metadata/writecache_manip.c b/lib/metadata/writecache_manip.c
abb29f
index 5004aa9..8150d07 100644
abb29f
--- a/lib/metadata/writecache_manip.c
abb29f
+++ b/lib/metadata/writecache_manip.c
abb29f
@@ -75,7 +75,7 @@ static int _get_writecache_kernel_status(struct cmd_context *cmd,
abb29f
 		return 0;
abb29f
 	}
abb29f
 
abb29f
-	if (!lv_info_with_seg_status(cmd, first_seg(lv), &status, 1, 1)) {
abb29f
+	if (!lv_info_with_seg_status(cmd, first_seg(lv), &status, 0, 0)) {
abb29f
 		log_error("Failed to get device mapper status for %s", display_lvname(lv));
abb29f
 		goto fail;
abb29f
 	}
abb29f
@@ -434,8 +434,12 @@ int lv_writecache_set_cleaner(struct logical_volume *lv)
abb29f
 	seg->writecache_settings.cleaner_set = 1;
abb29f
 
abb29f
 	if (lv_is_active(lv)) {
abb29f
-		if (!lv_update_and_reload(lv)) {
abb29f
-			log_error("Failed to update VG and reload LV.");
abb29f
+		if (!vg_write(lv->vg) || !vg_commit(lv->vg)) {
abb29f
+			log_error("Failed to update VG.");
abb29f
+			return 0;
abb29f
+		}
abb29f
+		if (!lv_writecache_message(lv, "cleaner")) {
abb29f
+			log_error("Failed to set writecache cleaner for %s.", display_lvname(lv));
abb29f
 			return 0;
abb29f
 		}
abb29f
 	} else {
abb29f
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
abb29f
index 4323965..7b74afb 100644
abb29f
--- a/tools/lvconvert.c
abb29f
+++ b/tools/lvconvert.c
abb29f
@@ -5720,6 +5720,8 @@ static int _lvconvert_detach_writecache_when_clean(struct cmd_context *cmd,
abb29f
 		return 0;
abb29f
 	}
abb29f
 
abb29f
+	log_debug("detach writecache check clean reading vg %s", id->vg_name);
abb29f
+
abb29f
 	vg = vg_read(cmd, id->vg_name, NULL, READ_FOR_UPDATE, lockd_state, &error_flags, NULL);
abb29f
 
abb29f
 	if (!vg) {