mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
Fix the ZFS checksum error histograms with larger record sizes
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alan Somers <asomers@gmail.com> Sponsored-by: Axcient Closes #15049
This commit is contained in:
parent
56ed389a57
commit
f917cf1c03
@ -790,7 +790,7 @@ update_histogram(uint64_t value_arg, uint8_t *hist, uint32_t *count)
|
||||
/* We store the bits in big-endian (largest-first) order */
|
||||
for (i = 0; i < 64; i++) {
|
||||
if (value & (1ull << i)) {
|
||||
hist[63 - i]++;
|
||||
hist[63 - i] = MAX(hist[63 - i], hist[63 - i] + 1);
|
||||
++bits;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user