Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl, | ||||
/* | /* | ||||
* If this is a resource notifying us of device removal then simply | * If this is a resource notifying us of device removal then simply | ||||
* check for an available spare and continue unless the device is a | * check for an available spare and continue unless the device is a | ||||
* l2arc vdev, in which case we just offline it. | * l2arc vdev, in which case we just offline it. | ||||
*/ | */ | ||||
if (strcmp(class, "resource.fs.zfs.removed") == 0 || | if (strcmp(class, "resource.fs.zfs.removed") == 0 || | ||||
(strcmp(class, "resource.fs.zfs.statechange") == 0 && | (strcmp(class, "resource.fs.zfs.statechange") == 0 && | ||||
state == VDEV_STATE_REMOVED)) { | (state == VDEV_STATE_REMOVED || state == VDEV_STATE_FAULTED))) { | ||||
char *devtype; | char *devtype; | ||||
char *devname; | char *devname; | ||||
if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, | if (nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, | ||||
&pool_guid) != 0 || | &pool_guid) != 0 || | ||||
nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, | nvlist_lookup_uint64(nvl, FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, | ||||
&vdev_guid) != 0) | &vdev_guid) != 0) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |