summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-09-27 16:55:05 -0700
committerBrian Behlendorf <[email protected]>2010-10-12 14:55:00 -0700
commit312c07edfdbdbabfab7f721797bba8eade5dcdeb (patch)
treeb74260aa669a021f23941b006e55a9e058ca45e1
parentd148e95156b98ac226013d24962d1afa4a51c712 (diff)
Generate zevents for speculative and soft errors
By default the Solaris code does not log speculative or soft io errors in either 'zpool status' or post an event. Under Linux we don't want to change the expected behavior of 'zpool status' so these io errors are still suppressed there. However, since we do need to know about these events for Linux FMA and the 'zpool events' interface is new we do post the events. With the addition of the zio_flags field the posted events now contain enough information that a user space consumer can identify and discard these events if it sees fit.
-rw-r--r--include/sys/fm/fs/zfs.h1
-rw-r--r--module/zfs/zfs_fm.c18
2 files changed, 3 insertions, 16 deletions
diff --git a/include/sys/fm/fs/zfs.h b/include/sys/fm/fs/zfs.h
index d5c71d174..d157ea153 100644
--- a/include/sys/fm/fs/zfs.h
+++ b/include/sys/fm/fs/zfs.h
@@ -80,6 +80,7 @@ extern "C" {
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_ERR "zio_err"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_OFFSET "zio_offset"
#define FM_EREPORT_PAYLOAD_ZFS_ZIO_SIZE "zio_size"
+#define FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS "zio_flags"
#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"
diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c
index c93057e8e..dd15c5d63 100644
--- a/module/zfs/zfs_fm.c
+++ b/module/zfs/zfs_fm.c
@@ -144,22 +144,6 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out,
zio->io_type != ZIO_TYPE_WRITE)
return;
- /*
- * Ignore any errors from speculative I/Os, as failure is an
- * expected result.
- */
- if (zio->io_flags & ZIO_FLAG_SPECULATIVE)
- return;
-
- /*
- * If this I/O is not a retry I/O, don't post an ereport.
- * Otherwise, we risk making bad diagnoses based on B_FAILFAST
- * I/Os.
- */
- if (zio->io_error == EIO &&
- !(zio->io_flags & ZIO_FLAG_IO_RETRY))
- return;
-
if (vd != NULL) {
/*
* If the vdev has already been marked as failing due
@@ -304,6 +288,8 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out,
*/
fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_ERR,
DATA_TYPE_INT32, zio->io_error, NULL);
+ fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_ZIO_FLAGS,
+ DATA_TYPE_INT32, zio->io_flags, NULL);
/*
* If the 'size' parameter is non-zero, it indicates this is a