svn commit: r297672 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Thu Apr 7 12:54:45 UTC 2016


Author: mav
Date: Thu Apr  7 12:54:44 2016
New Revision: 297672
URL: https://svnweb.freebsd.org/changeset/base/297672

Log:
  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.
  
  MFC after:	1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Thu Apr  7 11:21:42 2016	(r297671)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Thu Apr  7 12:54:44 2016	(r297672)
@@ -679,7 +679,15 @@ vdev_geom_open_by_path(vdev_t *vd, int c
 			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;


More information about the svn-src-all mailing list