diff options
author | mav <mav@FreeBSD.org> | 2016-04-14 09:10:09 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-04-14 09:10:09 +0000 |
commit | 5a7f6237bc082bbf0f2201c869dd48aa735e30b1 (patch) | |
tree | 06a2cdce88799cfaa47bbff04b0c2d483de9803d /sys/cddl | |
parent | 7d48c1b04d1bf73a37be5bf2ff88334bd25611ae (diff) | |
download | FreeBSD-src-5a7f6237bc082bbf0f2201c869dd48aa735e30b1.zip FreeBSD-src-5a7f6237bc082bbf0f2201c869dd48aa735e30b1.tar.gz |
MFC r297672: Alike to r293708 relax pool check in vdev_geom_open_by_path().
This made impossible spare disk open by known path, which kind of worked
only because the same fix was applied to vdev_geom_attach_by_guids() in
r293708.
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c | 10 |
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 d64001e..30eb903 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 @@ -676,7 +676,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; |