From b40d45bc6c0e908c4d1086ac8ac3dcd1f7178d2a Mon Sep 17 00:00:00 2001 From: bunder2015 Date: Tue, 17 Apr 2018 13:52:53 -0400 Subject: [PATCH] ZTS: fix reservation_013_pos integer overflow When using large disks the integers for calculating sizes can overflow past 2**31. Changing to long integers with typeset should correct this. Reviewed-by: Brian Behlendorf Signed-off-by: bunder2015 Closes #4444 Closes #7451 --- .../tests/functional/reservation/reservation_013_pos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.sh b/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.sh index 4ef15d5b6e..6a80bb575d 100755 --- a/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.sh +++ b/tests/zfs-tests/tests/functional/reservation/reservation_013_pos.sh @@ -75,9 +75,9 @@ space_avail=$(get_prop available $TESTPOOL) [[ $? -ne 0 ]] && \ log_fail "Unable to get space available property for $TESTPOOL" -((resv_set = space_avail / 5)) +typeset -il resv_set=space_avail/5 resv_set=$(floor_volsize $resv_set) -((sparse_vol_set_size = space_avail * 5)) +typeset -il sparse_vol_set_size=space_avail*5 sparse_vol_set_size=$(floor_volsize $sparse_vol_set_size) # When initially created, a regular volume's reservation property is set