Skip to content

Commit

Permalink
3517 importing pool with autoreplace=on and "hole" vdevs crashes syse…
Browse files Browse the repository at this point in the history
…ventd

Reviewed by: Albert Lee <[email protected]>
Reviewed by: Jeffry Molanus <[email protected]>
Reviewed by: George Wilson <[email protected]>
Approved by: Christopher Siden <[email protected]>
  • Loading branch information
Yuri Pankov authored and Christopher Siden committed Mar 7, 2013
1 parent 41610d1 commit efb4a87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion usr/src/cmd/syseventd/modules/zfs_mod/zfs_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

/*
Expand Down Expand Up @@ -518,7 +519,8 @@ zfs_deliver_check(nvlist_t *nvl)
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;
Expand Down
5 changes: 3 additions & 2 deletions usr/src/uts/common/fs/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

/*
Expand Down Expand Up @@ -1556,7 +1556,8 @@ spa_check_removed(vdev_t *vd)
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);
}
Expand Down

0 comments on commit efb4a87

Please sign in to comment.