Skip to content

Commit

Permalink
Remove wrong ASSERT in annotate_ecksum
Browse files Browse the repository at this point in the history
When using large blocks like 1M, there will be more than UINT16_MAX qwords in
one block, so this ASSERT would go off. Also, it is possible for the histogram
to overflow. We cap them to UINT16_MAX to prevent this.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#4257
  • Loading branch information
Chunwei Chen authored and nedbass committed May 1, 2016
1 parent 354424d commit 21ea946
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/zfs_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ update_histogram(uint64_t value_arg, uint16_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]++;
if (hist[63 - i] < UINT16_MAX)
hist[63 - i]++;
++bits;
}
}
Expand Down Expand Up @@ -615,7 +616,6 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info,
if (badbuf == NULL || goodbuf == NULL)
return (eip);

ASSERT3U(nui64s, <=, UINT16_MAX);
ASSERT3U(size, ==, nui64s * sizeof (uint64_t));
ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
ASSERT3U(size, <=, UINT32_MAX);
Expand Down

0 comments on commit 21ea946

Please sign in to comment.