summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunwei Chen <[email protected]>2016-01-22 12:23:55 -0800
committerBrian Behlendorf <[email protected]>2016-02-17 10:43:02 -0800
commit093911f1945b5c164a45bb077103283dafdcae0c (patch)
tree7f840b48f3cb65fd204f9a91d4d2cb66a9c41cbc
parenteea9309423d577d62cf62d1f98444e22e264ef15 (diff)
Remove wrong ASSERT in annotate_ecksum
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4257
-rw-r--r--module/zfs/zfs_fm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c
index 7e9c473d3..c7b718000 100644
--- a/module/zfs/zfs_fm.c
+++ b/module/zfs/zfs_fm.c
@@ -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;
}
}
@@ -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);