Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2016 17:23:57 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r299958 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201605161723.u4GHNvZ4066390@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Mon May 16 17:23:57 2016
New Revision: 299958
URL: https://svnweb.freebsd.org/changeset/base/299958

Log:
  MFC r298072
  
  Don't corrupt ZFS label's physpath attribute when booting while a disk is
  missing
  
  Prior to this change, vdev_geom_open_by_path would call vdev_geom_attach
  prior to verifying the device's GUIDs.  vdev_geom_attach calls
  vdev_geom_attrchange to set the physpath in the vdev object.  The result is
  that if the disk could not be found, then the labels for other disks in the
  same TLD would overwrite the missing disk's physpath with the physpath of
  whichever disk currently has the same devname as the missing one used to
  have.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Mon May 16 17:18:26 2016	(r299957)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Mon May 16 17:23:57 2016	(r299958)
@@ -241,9 +241,6 @@ vdev_geom_attach(struct g_provider *pp, 
 	cp->private = vd;
 	vd->vdev_tsd = cp;
 
-	/* Fetch initial physical path information for this device. */
-	vdev_geom_attrchanged(cp, "GEOM::physpath");
-	
 	cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
 	return (cp);
 }
@@ -796,6 +793,10 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 		}
 	}
 
+	/* Fetch initial physical path information for this device. */
+	if (cp != NULL)
+		vdev_geom_attrchanged(cp, "GEOM::physpath");
+	
 	g_topology_unlock();
 	PICKUP_GIANT();
 	if (cp == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605161723.u4GHNvZ4066390>