diff options
author | Tony Hutter <[email protected]> | 2016-10-19 12:55:59 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-10-19 12:55:59 -0700 |
commit | 6078881aa18a45ea065a887e2a8606279cdc0329 (patch) | |
tree | d6af96c545969994afdf2bf84ee1484b09cdf76c /cmd/zed/zed_event.c | |
parent | 7c502b0b1de8d3d341c026760df5915ad4be794a (diff) |
Multipath autoreplace, control enclosure LEDs, event rate limiting
1. Enable multipath autoreplace support for FMA.
This extends FMA autoreplace to work with multipath disks. This
requires libdevmapper to be installed at build time.
2. Turn on/off fault LEDs when VDEVs become degraded/faulted/online
Set ZED_USE_ENCLOSURE_LEDS=1 in zed.rc to have ZED turn on/off the enclosure
LED for a drive when a drive becomes FAULTED/DEGRADED. Your enclosure must
be supported by the Linux SES driver for this to work. The enclosure LED
scripts work for multipath devices as well. The scripts will clear the LED
when the fault is cleared.
3. Rate limit ZIO delay and checksum events so as not to flood ZED
ZIO delay and checksum events are rate limited to 5/sec in the zfs module.
Reviewed-by: Richard Laager <[email protected]>
Reviewed by: Don Brady <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes #2449
Closes #3017
Closes #5159
Diffstat (limited to 'cmd/zed/zed_event.c')
-rw-r--r-- | cmd/zed/zed_event.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c index 0e5c6793d..51f4f99c5 100644 --- a/cmd/zed/zed_event.c +++ b/cmd/zed/zed_event.c @@ -843,6 +843,23 @@ _zed_internal_event(const char *class, nvlist_t *nvl) } } +static void +_zed_event_add_upath(uint64_t eid, zed_strings_t *zsp, nvlist_t *nvl) +{ + char *path = NULL; + char *upath = NULL; + if (nvlist_lookup_string(nvl, FM_EREPORT_PAYLOAD_ZFS_VDEV_PATH, + &path) == 0) { + upath = get_underlying_path(NULL, path); + if (upath) { + _zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, + "VDEV_UPATH", + "%s", upath); + free(upath); + } + } +} + /* * Service the next zevent, blocking until one is available. */ @@ -912,8 +929,19 @@ zed_event_service(struct zed_conf *zcp) subclass = _zed_event_get_subclass(class); _zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "SUBCLASS", "%s", (subclass ? subclass : class)); + _zed_event_add_time_strings(eid, zsp, etime); + /* + * If a VDEV is included, resolve it's path to the "underlying + * device". This is useful for resolving device mapper and + * multipath devices to their underlying /dev/sd* devices. + * For example, if you have a DM or multipath VDEV + * (/dev/mapper/mpatha) that points to one or more /dev/sd* + * devices, this will return the first of its devices. + */ + _zed_event_add_upath(eid, zsp, nvl); + zed_exec_process(eid, class, subclass, zcp->zedlet_dir, zcp->zedlets, zsp, zcp->zevent_fd); |