--- a/usr/src/uts/common/fs/zfs/zfs_fm.c Thu Sep 17 11:03:46 2009 -0700
+++ b/usr/src/uts/common/fs/zfs/zfs_fm.c Thu Sep 17 15:21:48 2009 -0700
@@ -147,9 +147,7 @@
* not yet been asynchronously placed into the REMOVED
* state.
*/
- if (zio->io_vd == vd &&
- !vdev_accessible(vd, zio) &&
- strcmp(subclass, FM_EREPORT_ZFS_PROBE_FAILURE) != 0)
+ if (zio->io_vd == vd && !vdev_accessible(vd, zio))
return;
/*
@@ -164,6 +162,15 @@
}
}
+ /*
+ * For probe failure, we want to avoid posting ereports if we've
+ * already removed the device in the meantime.
+ */
+ if (vd != NULL &&
+ strcmp(subclass, FM_EREPORT_ZFS_PROBE_FAILURE) == 0 &&
+ (vd->vdev_remove_wanted || vd->vdev_state == VDEV_STATE_REMOVED))
+ return;
+
if ((ereport = fm_nvlist_create(NULL)) == NULL)
return;
@@ -338,6 +345,9 @@
nvlist_t *resource;
char class[64];
+ if (spa->spa_load_state == SPA_LOAD_TRYIMPORT)
+ return;
+
if ((resource = fm_nvlist_create(NULL)) == NULL)
return;