changeset 13979:b01a4832cdf9

3517 importing pool with autoreplace=on and "hole" vdevs crashes syseventd Reviewed by: Albert Lee <trisk@nexenta.com> Reviewed by: Jeffry Molanus <jeffry.molanus@nexenta.com> Reviewed by: George Wilson <gwilson@zfsmail.com> Approved by: Christopher Siden <christopher.siden@delphix.com>
author Yuri Pankov <yuri.pankov@nexenta.com>
date Wed, 06 Mar 2013 17:57:09 -0800
parents 027f8df5b5ef
children d7059eb1884c
files usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c usr/src/uts/common/fs/zfs/spa.c
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c	Wed Feb 06 13:53:06 2013 +0400
+++ b/usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c	Wed Mar 06 17:57:09 2013 -0800
@@ -21,6 +21,7 @@
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  */
 
 /*
@@ -518,7 +519,8 @@
 	if (nvlist_lookup_uint64(nvl, ZFS_EV_POOL_GUID,
 	    &data.dd_pool_guid) != 0 ||
 	    nvlist_lookup_uint64(nvl, ZFS_EV_VDEV_GUID,
-	    &data.dd_vdev_guid) != 0)
+	    &data.dd_vdev_guid) != 0 ||
+	    data.dd_vdev_guid == 0)
 		return (0);
 
 	data.dd_isdisk = B_TRUE;
--- a/usr/src/uts/common/fs/zfs/spa.c	Wed Feb 06 13:53:06 2013 +0400
+++ b/usr/src/uts/common/fs/zfs/spa.c	Wed Mar 06 17:57:09 2013 -0800
@@ -21,8 +21,8 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  */
 
 /*
@@ -1556,7 +1556,8 @@
 	for (int c = 0; c < vd->vdev_children; c++)
 		spa_check_removed(vd->vdev_child[c]);
 
-	if (vd->vdev_ops->vdev_op_leaf && vdev_is_dead(vd)) {
+	if (vd->vdev_ops->vdev_op_leaf && vdev_is_dead(vd) &&
+	    !vd->vdev_ishole) {
 		zfs_post_autoreplace(vd->vdev_spa, vd);
 		spa_event_notify(vd->vdev_spa, vd, ESC_ZFS_VDEV_CHECK);
 	}