From e8c3d0846c7bb581d417e460a3a8a8a32df2081d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 11 Aug 2022 10:10:27 +0200 Subject: [slx-dmsetup] Cannot make a local var with same name as global readonly --- modules.d/slx-dmsetup/scripts/dmsetup-slx-device | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules.d/slx-dmsetup/scripts/dmsetup-slx-device b/modules.d/slx-dmsetup/scripts/dmsetup-slx-device index 3551a6eb..65ee94b5 100755 --- a/modules.d/slx-dmsetup/scripts/dmsetup-slx-device +++ b/modules.d/slx-dmsetup/scripts/dmsetup-slx-device @@ -42,7 +42,7 @@ handle_unit() { case "$2" in [%]) # These are relative to the writable CoW device # Allow > 100% for over-provisioning - val="$(( writable_device_sz * val / 100 ))" + val="$(( remaining_device_sz * val / 100 ))" ;; [Kk]) potency=1 ;;& [Mm]) potency=2 ;;& @@ -58,7 +58,7 @@ handle_unit() { } parse_config() { - local writable_device_sz="$writable_device_sz" + local remaining_device_sz="$writable_device_sz" parse_config_int "$1" 0 parse_config_int "$1" 1 } @@ -131,7 +131,7 @@ parse_config_int() { esac # Decrease for upcoming calculations if we used fixed values here if [ "$rel_only" != 1 ]; then - (( writable_device_sz -= ( min + max ) / 2 )) + (( remaining_device_sz -= ( min + max ) / 2 )) fi done <<< "$1" } -- cgit v1.2.3-55-g7522