mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 3 years ago
Clone
Blob Blame History Raw
 WHATS_NEW                  |  4 ++++
 lib/activate/dev_manager.c | 14 +++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/WHATS_NEW b/WHATS_NEW
index 50a0045..30f1391 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,7 @@
+Version 2.03.09 - 
+====================================
+  Fix showing of a dm kernel error when uncaching a volume with cachevol.
+
 Version 2.03.08 - 11th February 2020
 ====================================
   Prevent problematic snapshots of writecache volumes.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 8569e86..c8a22fb 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3161,8 +3161,8 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 		char *dlid_meta;
 		char *dlid_data;
 		char *dlid_pool;
-		uint64_t meta_len = first_seg(lv)->metadata_len;
-		uint64_t data_len = first_seg(lv)->data_len;
+		uint64_t meta_size = first_seg(lv)->metadata_len;
+		uint64_t data_size = first_seg(lv)->data_len;
 		uint16_t udev_flags = _get_udev_flags(dm, lv, layer,
 					     laopts->noscan, laopts->temporary,
 					     0);
@@ -3210,12 +3210,12 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 
 		if (dm->track_pending_delete) {
 			log_debug_activation("Using error for pending meta delete %s.", display_lvname(lv));
-			if (!dm_tree_node_add_error_target(dnode_meta, (uint64_t)lv->vg->extent_size * meta_len))
+			if (!dm_tree_node_add_error_target(dnode_meta, meta_size))
 				return_0;
 		} else {
 			/* add load_segment to meta dnode: linear, size of meta area */
 			if (!add_linear_area_to_dtree(dnode_meta,
-						      meta_len,
+						      meta_size,
 						      lv->vg->extent_size,
 						      lv->vg->cmd->use_linear_target,
 						      lv->vg->name, lv->name))
@@ -3239,19 +3239,19 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 
 		if (dm->track_pending_delete) {
 			log_debug_activation("Using error for pending data delete %s.", display_lvname(lv));
-			if (!dm_tree_node_add_error_target(dnode_data, (uint64_t)lv->vg->extent_size * data_len))
+			if (!dm_tree_node_add_error_target(dnode_data, data_size))
 				return_0;
 		} else {
 			/* add load_segment to data dnode: linear, size of data area */
 			if (!add_linear_area_to_dtree(dnode_data,
-						      data_len,
+						      data_size,
 						      lv->vg->extent_size,
 						      lv->vg->cmd->use_linear_target,
 						      lv->vg->name, lv->name))
 				return_0;
 
 			/* add seg_area to prev load_seg: offset 0 maps to cachepool lv after meta */
-			if (!dm_tree_node_add_target_area(dnode_data, NULL, dlid_pool, meta_len))
+			if (!dm_tree_node_add_target_area(dnode_data, NULL, dlid_pool, meta_size))
 				return_0;
 		}
 	}