From 1a493a955530e408310cb1008faacef987ba8a6d Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 21 Jul 2010 12:49:09 -0700 Subject: [PATCH] Add vdev_state to common post info This was done because there are now lots of resource.fs.zfs.statechange events being posted but they do not include the state. For the moment the state must always be healthy but there's no harm in making this explicit. --- module/zfs/include/sys/fm/fs/zfs.h | 1 + module/zfs/zfs_fm.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/zfs/include/sys/fm/fs/zfs.h b/module/zfs/include/sys/fm/fs/zfs.h index 70f0843faf..ba542d8220 100644 --- a/module/zfs/include/sys/fm/fs/zfs.h +++ b/module/zfs/include/sys/fm/fs/zfs.h @@ -67,6 +67,7 @@ extern "C" { #define FM_EREPORT_PAYLOAD_ZFS_VDEV_PATH "vdev_path" #define FM_EREPORT_PAYLOAD_ZFS_VDEV_DEVID "vdev_devid" #define FM_EREPORT_PAYLOAD_ZFS_VDEV_FRU "vdev_fru" +#define FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE "vdev_state" #define FM_EREPORT_PAYLOAD_ZFS_PARENT_GUID "parent_guid" #define FM_EREPORT_PAYLOAD_ZFS_PARENT_TYPE "parent_type" #define FM_EREPORT_PAYLOAD_ZFS_PARENT_PATH "parent_path" diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c index 409f4f99fb..a74f195778 100644 --- a/module/zfs/zfs_fm.c +++ b/module/zfs/zfs_fm.c @@ -820,9 +820,12 @@ zfs_post_common(spa_t *spa, vdev_t *vd, const char *name) VERIFY(nvlist_add_string(resource, FM_CLASS, class) == 0); VERIFY(nvlist_add_uint64(resource, FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, spa_guid(spa)) == 0); - if (vd) + if (vd) { VERIFY(nvlist_add_uint64(resource, FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, vd->vdev_guid) == 0); + VERIFY(nvlist_add_uint64(resource, + FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE, vd->vdev_state) == 0); + } fm_zevent_post(resource, NULL, zfs_zevent_post_cb); #endif