Limit the number of blocks to discard at once.
[zfs.git] / module / zfs / zfs_fm.c
index dd15c5d..7801837 100644 (file)
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
+
 #include <sys/spa.h>
 #include <sys/spa_impl.h>
 #include <sys/vdev.h>
@@ -290,6 +294,8 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out,
                    DATA_TYPE_INT32, zio->io_error, NULL);
                fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS,
                    DATA_TYPE_INT32, zio->io_flags, NULL);
+               fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_DELAY,
+                   DATA_TYPE_UINT64, zio->io_delay, NULL);
 
                /*
                 * If the 'size' parameter is non-zero, it indicates this is a
@@ -704,6 +710,10 @@ zfs_ereport_start_checksum(spa_t *spa, vdev_t *vd,
 
        if (report->zcr_ereport == NULL) {
                report->zcr_free(report->zcr_cbdata, report->zcr_cbinfo);
+               if (report->zcr_ckinfo != NULL) {
+                       kmem_free(report->zcr_ckinfo,
+                           sizeof (*report->zcr_ckinfo));
+               }
                kmem_free(report, sizeof (*report));
                return;
        }