Blob Blame History Raw
 WHATS_NEW_DM          | 4 ++++
 libdm/libdm-deptree.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 9e30786..71b25ba 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,7 @@
+Version 1.02.110 - 
+======================================
+  Enforce writethrough mode for cleaner policy.
+
 Version 1.02.108 - 
 =====================================
   Do not check for full thin pool when activating without messages (1.02.107).
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index 7b7ca5b..fc79e33 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -3456,7 +3456,8 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node,
 		return_0;
 
 	seg->data_block_size = data_block_size;
-	seg->flags = feature_flags;
+	/* Enforce WriteThough mode for cleaner policy */
+	seg->flags = (strcmp(policy_name, "cleaner") == 0) ? DM_CACHE_FEATURE_WRITETHROUGH : feature_flags;
 	seg->policy_name = policy_name;
 
 	/* FIXME: better validation missing */