Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Dec 2009 14:24:22 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200125 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200912051424.nB5EOMj6090164@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sat Dec  5 14:24:22 2009
New Revision: 200125
URL: http://svn.freebsd.org/changeset/base/200125

Log:
  Always check guid when opening by path, because we may end up with provider
  that does have the same name, but only by accident.
  
  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	Sat Dec  5 14:21:42 2009	(r200124)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c	Sat Dec  5 14:24:22 2009	(r200125)
@@ -448,7 +448,7 @@ vdev_geom_open_by_guid(vdev_t *vd)
 }
 
 static struct g_consumer *
-vdev_geom_open_by_path(vdev_t *vd, int check_guid)
+vdev_geom_open_by_path(vdev_t *vd)
 {
 	struct g_provider *pp;
 	struct g_consumer *cp;
@@ -460,7 +460,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c
 	if (pp != NULL) {
 		ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path);
 		cp = vdev_geom_attach(pp, !!(spa_mode & FWRITE));
-		if (cp != NULL && check_guid) {
+		if (cp != NULL) {
 			g_topology_unlock();
 			guid = vdev_geom_read_guid(cp);
 			g_topology_lock();
@@ -501,7 +501,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 
 	if ((owned = mtx_owned(&Giant)))
 		mtx_unlock(&Giant);
-	cp = vdev_geom_open_by_path(vd, 0);
+	cp = vdev_geom_open_by_path(vd);
 	if (cp == NULL) {
 		/*
 		 * The device at vd->vdev_path doesn't have the expected guid.
@@ -510,8 +510,6 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi
 		 */
 		cp = vdev_geom_open_by_guid(vd);
 	}
-	if (cp == NULL)
-		cp = vdev_geom_open_by_path(vd, 1);
 	if (cp == NULL) {
 		ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
 		vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED;



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