From f75574cbaaa1ade5bf24ab11751cbd5bc62ef7f1 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Tue, 16 Apr 2024 15:03:33 +1000 Subject: tests/quota_005_pos: use a long int for doubling the quota size When run in isolation, quota_005_pos would see an empty ~300G dataset. Doubling it's space overflows a int32, which meant it was trying to then set the quota to a negative value, and would fail. When run as part of the quota tests, the filesystem appears to have stuff in it, and so a lower available space, which doesn't overflow, and so succeeds. The bare minimum fix seems to be to use a int64 for the available space, so it can be comfortably doubled. Here it is. (Also a typo fix and a tiny bit of cleanup). Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Signed-off-by: Rob Norris Closes #16097 --- tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh b/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh index 98ee4edae650..fb3d97f486de 100755 --- a/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh +++ b/tests/zfs-tests/tests/functional/quota/quota_005_pos.ksh @@ -55,15 +55,14 @@ function cleanup log_onexit cleanup -log_assert "Verify that quota doesnot inherit its value from parent." -log_onexit cleanup +log_assert "Verify that quota does not inherit its value from parent." fs=$TESTPOOL/$TESTFS fs_child=$TESTPOOL/$TESTFS/$TESTFS space_avail=$(get_prop available $fs) quota_val=$(get_prop quota $fs) -typeset -i quotasize=$space_avail +typeset -li quotasize=$space_avail ((quotasize = quotasize * 2 )) log_must zfs set quota=$quotasize $fs @@ -72,4 +71,4 @@ quota_space=$(get_prop quota $fs_child) [[ $quota_space == $quotasize ]] && \ log_fail "The quota of child dataset inherits its value from parent." -log_pass "quota doesnot inherit its value from parent as expected." +log_pass "quota does not inherit its value from parent as expected." -- cgit v1.2.3