HomeFreeBSD

MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks

Description

MFV r329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks

illumos/illumos-gate@a6c1eb3c08094a6db69aa1dc6315bc814e82e79c
https://github.com/illumos/illumos-gate/commit/a6c1eb3c08094a6db69aa1dc6315bc814e82e79c

https://www.illumos.org/issues/8731

annotate_ecksum() asserts that nui64s, calculated as nui64s = size / sizeof
(uint64_t), is not greater than UINT16_MAX.
This restriction is needed because histograms of incorrectly set and cleared
bits have 16 bit counters and if the buffer consists of too many 64-bit words,
then a counter can potentially overflow producing an incorrect result.
When the largest buffer size was 128KB the greatest value of nui64s was 16K,
well within the limit.
But now we have support for large buffers and for buffer sizes of 512KB and
above the restriction is violated.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 2 weeks

Details

Provenance
avgAuthored on
Reviewer
matthew
Parents
rS329713: 8731 ASSERT3U(nui64s, <=, UINT16_MAX) fails for large blocks
Branches
Unknown
Tags
Unknown