summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2017-07-24 11:16:58 -0700
committerBrian Behlendorf <[email protected]>2017-07-24 11:16:58 -0700
commit802ae562ed817af978e2636806db1952d29ee86d (patch)
treed67a37dddedc2ee71e9e75acf4c7e4d33122a621 /module/zfs/spa.c
parent39554216dff2c8bd4a2fa296644b5e3723ce8ed3 (diff)
Fix coverity defects: CID 165755
CID 165755: Division or modulo by zero (DIVIDE_BY_ZERO) Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #6352
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 7edf0459c..f576293eb 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -2448,7 +2448,7 @@ spa_activity_check(spa_t *spa, uberblock_t *ub, nvlist_t *config)
*/
if (ub->ub_mmp_magic == MMP_MAGIC && ub->ub_mmp_delay)
import_delay = MAX(import_delay, import_intervals *
- ub->ub_mmp_delay * vdev_count_leaves(spa));
+ ub->ub_mmp_delay * MAX(vdev_count_leaves(spa), 1));
/* Apply a floor using the local default values. */
import_delay = MAX(import_delay, import_intervals *