Fix the ZFS checksum error histograms with larger record sizes #15049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My analysis in PR #14716 was incorrect. Each histogram bucket contains the number of incorrect bits, by position in a 64-bit word, over the entire record. 8-bit buckets can overflow for record sizes above 2k. To forestall that, saturate each bucket at 255. That should still get the point across: either all bits are equally wrong, or just a couple are.
Sponsored-by: Axcient
Signed-off-by: Alan Somers [email protected]
Motivation and Context
After PR #14716, the bad_cleared_histogram and bad_set_histogram fields of an ereport.fs.zfs.checksum event could contain incorrect values for record sizes of 2kB and above, due to an integer overflow.
Description
Rather than overflow, saturate the histogram buckets at 255. That will still be sufficient for diagnostic purposes.
How Has This Been Tested?
Tested on FreeBSD 14 using the zfsd_degrade_001_pos test case from FreeBSD's zfsd test suite.
Types of changes
Checklist:
Signed-off-by
.