Blame SOURCES/0052-vdo-fix-conversion-of-vdo_slab_size_mb.patch

4d51e5
From 7cb63b05dad453d015bbe462b799fb031dd6952c Mon Sep 17 00:00:00 2001
4d51e5
From: Zdenek Kabelac <zkabelac@redhat.com>
4d51e5
Date: Tue, 31 May 2022 22:48:38 +0200
4d51e5
Subject: [PATCH 52/54] vdo: fix conversion of vdo_slab_size_mb
4d51e5
4d51e5
When converting VDO volume, the parameter vdo_slabSize was
4d51e5
incorrectly copied as vdo_blockMapCacheSize, however this parameter
4d51e5
is then no longer used for any table line creation so the wrong
4d51e5
value was only stored in metadata.
4d51e5
4d51e5
Also use just single get_kb_size_with_unit_ and remove it's duplicate
4d51e5
functionality with get_mb_size_with_unit_.
4d51e5
4d51e5
Use $VERB for vdo remove call.
4d51e5
---
4d51e5
 scripts/lvm_import_vdo.sh | 13 ++-----------
4d51e5
 1 file changed, 2 insertions(+), 11 deletions(-)
4d51e5
4d51e5
diff --git a/scripts/lvm_import_vdo.sh b/scripts/lvm_import_vdo.sh
4d51e5
index 61a82e41e..beb55dbdb 100755
4d51e5
--- a/scripts/lvm_import_vdo.sh
4d51e5
+++ b/scripts/lvm_import_vdo.sh
4d51e5
@@ -125,15 +125,6 @@ get_kb_size_with_unit_() {
4d51e5
 	esac
4d51e5
 }
4d51e5
 
4d51e5
-get_mb_size_with_unit_() {
4d51e5
-	case "$1" in
4d51e5
-	*[mM]) echo $(( ${1%[mM]} )) ;;
4d51e5
-	*[gG]) echo $(( ${1%[gG]} * 1024 )) ;;
4d51e5
-	*[tT]) echo $(( ${1%[tT]} * 1024 * 1024 )) ;;
4d51e5
-	*[pP]) echo $(( ${1%[pP]} * 1024 * 1024 * 1024 )) ;;
4d51e5
-	esac
4d51e5
-}
4d51e5
-
4d51e5
 # Figure out largest possible extent size usable for VG
4d51e5
 # $1   physical size
4d51e5
 # $2   logical size
4d51e5
@@ -328,12 +319,12 @@ allocation {
4d51e5
 	vdo_use_deduplication = $(get_enabled_value_ "$vdo_deduplication")
4d51e5
 	vdo_use_metadata_hints=1
4d51e5
 	vdo_minimum_io_size = $vdo_logicalBlockSize
4d51e5
-	vdo_block_map_cache_size_mb = $(get_mb_size_with_unit_ "$vdo_blockMapCacheSize")
4d51e5
+	vdo_block_map_cache_size_mb = $(( $(get_kb_size_with_unit_ "$vdo_blockMapCacheSize") / 1024 ))
4d51e5
 	vdo_block_map_period = $vdo_blockMapPeriod
4d51e5
 	vdo_check_point_frequency = $vdo_indexCfreq
4d51e5
 	vdo_use_sparse_index = $(get_enabled_value_ "$vdo_indexSparse")
4d51e5
 	vdo_index_memory_size_mb = $(awk "BEGIN {print $vdo_indexMemory * 1024}")
4d51e5
-	vdo_slab_size_mb = $(get_mb_size_with_unit_ "$vdo_blockMapCacheSize")
4d51e5
+	vdo_slab_size_mb = $(( $(get_kb_size_with_unit_ "$vdo_blockMapCacheSize") / 1024 ))
4d51e5
 	vdo_ack_threads = $vdo_ackThreads
4d51e5
 	vdo_bio_threads = $vdo_bioThreads
4d51e5
 	vdo_bio_rotation = $vdo_bioRotationInterval
4d51e5
-- 
4d51e5
2.34.3
4d51e5