diff options
author | Olaf Faaland <[email protected]> | 2018-04-06 13:29:11 -0700 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2018-07-06 02:46:51 -0700 |
commit | 6b5cc49d81305b25b2d6a1348bf34f05dbd9a409 (patch) | |
tree | 393a737f23c802bab650e61bdded260e7f14a9eb /module | |
parent | ef7a79488a498b430108a1d74647f57da9a78284 (diff) |
Fix divide-by-zero in mmp_delay_update()
vdev_count_leaves() in the denominator may return 0, caught by Coverity.
Introduced by
* 533ea04 Update mmp_delay on sync or skipped, failed write
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Giuseppe Di Natale <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Olaf Faaland <[email protected]>
Closes #7391
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/mmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c index 1ae5f31fd..3b74a6b61 100644 --- a/module/zfs/mmp.c +++ b/module/zfs/mmp.c @@ -327,7 +327,7 @@ mmp_delay_update(spa_t *spa, boolean_t write_completed) */ if (delay < mts->mmp_delay) { hrtime_t min_delay = MSEC2NSEC(zfs_multihost_interval) / - vdev_count_leaves(spa); + MAX(1, vdev_count_leaves(spa)); mts->mmp_delay = MAX(((delay + mts->mmp_delay * 127) / 128), min_delay); } |