From owner-svn-src-head@FreeBSD.ORG Sat Dec 5 14:24:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D8DD1065676; Sat, 5 Dec 2009 14:24:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9988FC15; Sat, 5 Dec 2009 14:24:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5EOMA2090166; Sat, 5 Dec 2009 14:24:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5EOMj6090164; Sat, 5 Dec 2009 14:24:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200912051424.nB5EOMj6090164@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 5 Dec 2009 14:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200125 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 14:24:22 -0000 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;