-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix divide-by-zero in mmp_delay_update() #7391
Conversation
vdev_count_leaves() in the denominator may return 0, caught by Coverity. Introduced by * 533ea04 Update mmp_delay on sync or skipped, failed write Signed-off-by: Olaf Faaland <[email protected]>
53cb9b3
to
3f391d4
Compare
Codecov Report
@@ Coverage Diff @@
## master #7391 +/- ##
==========================================
- Coverage 76.39% 76.33% -0.06%
==========================================
Files 329 329
Lines 104248 104248
==========================================
- Hits 79638 79576 -62
- Misses 24610 24672 +62
Continue to review full report at Codecov.
|
It looks like this patch still needs to be landed onto 0.7, or is |
@tonyhutter , can you consider this for 0.7.10? |
Yep, I'll include it |
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 openzfs#7391
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 openzfs#7391
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 openzfs#7391
Description
Replace vdev_count_leaves() with MAX(1,vdev_count_leaves()) in denominator of expression.
Motivation and Context
vdev_count_leaves() may return 0, resulting in divide-by-zero. Caught by Coverity.
Introduced by
How Has This Been Tested?
Types of changes
Checklist:
Signed-off-by
.