From: Prakash Surya Date: Wed, 18 Jan 2017 01:08:12 +0000 (-0800) Subject: OpenZFS 7762 - avoid division by zero in property_alias_001_pos X-Git-Tag: zfs-0.7.0-rc4~144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce456d483c6a30223bbbfd2308f44945d34dec8d;p=zfs OpenZFS 7762 - avoid division by zero in property_alias_001_pos Authored by: Prakash Surya Reviewed by: John Kennedy Reviewed by: Matt Ahrens Approved by: Dan McDonald Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Ported-by: Giuseppe Di Natale OpenZFS-issue: https://www.illumos.org/issues/7762 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ebaf15cb Closes #5798 --- diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh index d2f8cee92..5d24515b5 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh @@ -25,6 +25,10 @@ # Use is subject to license terms. # +# +# Copyright (c) 2016, 2017 by Delphix. All rights reserved. +# + . $STF_SUITE/include/libtest.shlib . $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib @@ -107,7 +111,7 @@ for ds in $pool $fs $vol; do done ;; reservation|reserv ) - (( reservsize = $avail_space % $RANDOM )) + (( reservsize = $avail_space % (( $RANDOM + 1 )) )) for val in "0" "$reservsize" "none"; do set_and_check $ds ${rw_prop[i]} $val ${chk_prop[i]} done