]> granicus.if.org Git - zfs/commitdiff
OpenZFS 7762 - avoid division by zero in property_alias_001_pos
authorPrakash Surya <prakash.surya@delphix.com>
Wed, 18 Jan 2017 01:08:12 +0000 (17:08 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 16 Feb 2017 01:19:54 +0000 (17:19 -0800)
Authored by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>
OpenZFS-issue: https://www.illumos.org/issues/7762
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ebaf15cb
Closes #5798

tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh

index d2f8cee92891de3ecb1e7f40c9fc4122e9d574b1..5d24515b50c45b4dec74b4002d8648dad5181d74 100755 (executable)
 # 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