]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Don't emit cksum_{actual_expected} in ereport.fs.zfs.checksum events
authorAlan Somers <asomers@FreeBSD.org>
Tue, 11 Jul 2023 21:13:57 +0000 (15:13 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Jul 2023 18:49:26 +0000 (11:49 -0700)
With anything but fletcher-4, even a tiny change in the input will cause
the checksum value to change completely.  So knowing the actual and
expected checksums doesn't provide much more information than "they
don't match".  The harm in sending them is simply that they bloat the
event.  In particular, on FreeBSD the event must fit into a 1016 byte
buffer.

Fixes #14717 for mirrored pools.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Alan Somers <asomers@gmail.com>
Sponsored-by: Axcient
Closes #14717
Closes #15052

include/sys/fm/fs/zfs.h
include/sys/zio_checksum.h
man/man8/zpool-events.8
module/zfs/vdev_indirect.c
module/zfs/vdev_raidz.c
module/zfs/zfs_fm.c
module/zfs/zio_checksum.c

index 3cf2b1274dd2c5472a05746d66611b01d6efba98..fb9e8649221e314c3eb2ce12133a48a258001f5d 100644 (file)
@@ -102,8 +102,6 @@ extern "C" {
 #define        FM_EREPORT_PAYLOAD_ZFS_ZIO_TIMESTAMP    "zio_timestamp"
 #define        FM_EREPORT_PAYLOAD_ZFS_ZIO_DELTA        "zio_delta"
 #define        FM_EREPORT_PAYLOAD_ZFS_PREV_STATE       "prev_state"
-#define        FM_EREPORT_PAYLOAD_ZFS_CKSUM_EXPECTED   "cksum_expected"
-#define        FM_EREPORT_PAYLOAD_ZFS_CKSUM_ACTUAL     "cksum_actual"
 #define        FM_EREPORT_PAYLOAD_ZFS_CKSUM_ALGO       "cksum_algorithm"
 #define        FM_EREPORT_PAYLOAD_ZFS_CKSUM_BYTESWAP   "cksum_byteswap"
 #define        FM_EREPORT_PAYLOAD_ZFS_BAD_OFFSET_RANGES "bad_ranges"
index 9fb79ab4a54b2d65fad6cbe0dbcd3572c5aaadfa..37fd65b7cb3eaac936e8076628c9d9be60aa0627 100644 (file)
@@ -94,8 +94,6 @@ typedef const struct zio_checksum_info {
 } zio_checksum_info_t;
 
 typedef struct zio_bad_cksum {
-       zio_cksum_t             zbc_expected;
-       zio_cksum_t             zbc_actual;
        const char              *zbc_checksum_name;
        uint8_t                 zbc_byteswapped;
        uint8_t                 zbc_injected;
index c3bd3208e63b2ac5b05aef5f4fff4f266186cc02..e1436f6ded57260ab5940a7c46930b22133cfe4f 100644 (file)
@@ -305,10 +305,6 @@ The time when a given I/O request was submitted.
 The time required to service a given I/O request.
 .It Sy prev_state
 The previous state of the vdev.
-.It Sy cksum_expected
-The expected checksum value for the block.
-.It Sy cksum_actual
-The actual checksum value for an errant block.
 .It Sy cksum_algorithm
 Checksum algorithm used.
 See
index 89667585345dbd1107ff588b7b3124a965d85e6c..acb725696674df79270b004380136b8e2d7545e6 100644 (file)
@@ -1398,7 +1398,7 @@ vdev_indirect_checksum_error(zio_t *zio,
        vd->vdev_stat.vs_checksum_errors++;
        mutex_exit(&vd->vdev_stat_lock);
 
-       zio_bad_cksum_t zbc = {{{ 0 }}};
+       zio_bad_cksum_t zbc = { 0 };
        abd_t *bad_abd = ic->ic_data;
        abd_t *good_abd = is->is_good_child->ic_data;
        (void) zfs_ereport_post_checksum(zio->io_spa, vd, NULL, zio,
index 14b98a76b84fd72a72b93374b9b7d9c64abda996..3445fa9d35d5dd8918f06bba429416052cffcd8f 100644 (file)
@@ -1785,7 +1785,7 @@ vdev_raidz_checksum_error(zio_t *zio, raidz_col_t *rc, abd_t *bad_data)
 static int
 raidz_checksum_verify(zio_t *zio)
 {
-       zio_bad_cksum_t zbc = {{{0}}};
+       zio_bad_cksum_t zbc = {0};
        raidz_map_t *rm = zio->io_vsd;
 
        int ret = zio_checksum_error(zio, &zbc);
index 9365ca500d7d4d688846f70e6b07512259dda2e6..c4eb74e873db2b6bd9fadea01e8c5c3f5b73f38d 100644 (file)
@@ -914,14 +914,6 @@ annotate_ecksum(nvlist_t *ereport, zio_bad_cksum_t *info,
 
        if (info != NULL && info->zbc_has_cksum) {
                fm_payload_set(ereport,
-                   FM_EREPORT_PAYLOAD_ZFS_CKSUM_EXPECTED,
-                   DATA_TYPE_UINT64_ARRAY,
-                   sizeof (info->zbc_expected) / sizeof (uint64_t),
-                   (uint64_t *)&info->zbc_expected,
-                   FM_EREPORT_PAYLOAD_ZFS_CKSUM_ACTUAL,
-                   DATA_TYPE_UINT64_ARRAY,
-                   sizeof (info->zbc_actual) / sizeof (uint64_t),
-                   (uint64_t *)&info->zbc_actual,
                    FM_EREPORT_PAYLOAD_ZFS_CKSUM_ALGO,
                    DATA_TYPE_STRING,
                    info->zbc_checksum_name,
index 6090959c5b8ced61f19b7e9b0ac734c585ae8e1d..9de515e8767a2cbf11f2d52e4acc0b54291212e1 100644 (file)
@@ -515,8 +515,6 @@ zio_checksum_error_impl(spa_t *spa, const blkptr_t *bp,
        }
 
        if (info != NULL) {
-               info->zbc_expected = expected_cksum;
-               info->zbc_actual = actual_cksum;
                info->zbc_checksum_name = ci->ci_name;
                info->zbc_byteswapped = byteswap;
                info->zbc_injected = 0;