]> granicus.if.org Git - zfs/commitdiff
Check b_freeze_cksum under ZFS_DEBUG_MODIFY conditional
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 3 Jul 2019 20:01:54 +0000 (13:01 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Jul 2019 20:01:54 +0000 (13:01 -0700)
The b_freeze_cksum field can only have data when ZFS_DEBUG_MODIFY
is set.  Therefore, the EQUIV check must be wrapped accordingly.
For the same reason the ASSERT in arc_buf_fill() in unsafe.
However, since it's largely redundant it has simply been removed.

Reviewed-by: George Wilson <gwilson@delphix.com>
Reviewed-by: Allan Jude <allanjude@freebsd.org>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8979

module/zfs/arc.c

index 837ef180179c45c047a74fe38fc2f6dbe545767a..98bafeee28dc52bcc3bbe636fa9344ee26fb5607 100644 (file)
@@ -1872,7 +1872,8 @@ arc_buf_try_copy_decompressed_data(arc_buf_t *buf)
         * There were no decompressed bufs, so there should not be a
         * checksum on the hdr either.
         */
-       EQUIV(!copied, hdr->b_l1hdr.b_freeze_cksum == NULL);
+       if (zfs_flags & ZFS_DEBUG_MODIFY)
+               EQUIV(!copied, hdr->b_l1hdr.b_freeze_cksum == NULL);
 
        return (copied);
 }
@@ -2253,7 +2254,6 @@ arc_buf_fill(arc_buf_t *buf, spa_t *spa, const zbookmark_phys_t *zb,
                 */
                if (arc_buf_try_copy_decompressed_data(buf)) {
                        /* Skip byteswapping and checksumming (already done) */
-                       ASSERT3P(hdr->b_l1hdr.b_freeze_cksum, !=, NULL);
                        return (0);
                } else {
                        error = zio_decompress_data(HDR_GET_COMPRESS(hdr),