summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
index 1fd9623..f459655 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
@@ -679,7 +679,15 @@ vdev_geom_open_by_path(vdev_t *vd, int check_guid)
g_topology_unlock();
vdev_geom_read_guids(cp, &pguid, &vguid);
g_topology_lock();
- if (pguid != spa_guid(vd->vdev_spa) ||
+ /*
+ * Check that the label's vdev guid matches the
+ * desired guid. If the label has a pool guid,
+ * check that it matches too. (Inactive spares
+ * and L2ARCs do not have any pool guid in the
+ * label.)
+ */
+ if ((pguid != 0 &&
+ pguid != spa_guid(vd->vdev_spa)) ||
vguid != vd->vdev_guid) {
vdev_geom_close_locked(vd);
cp = NULL;
OpenPOWER on IntegriCloud