From owner-cvs-src-old@FreeBSD.ORG Fri Mar 19 20:14:42 2010 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FFF7106568D for ; Fri, 19 Mar 2010 20:14:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1BE8FC18 for ; Fri, 19 Mar 2010 20:14:42 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o2JKEg5W067873 for ; Fri, 19 Mar 2010 20:14:42 GMT (envelope-from pjd@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o2JKEgJk067872 for cvs-src-old@freebsd.org; Fri, 19 Mar 2010 20:14:42 GMT (envelope-from pjd@repoman.freebsd.org) Message-Id: <201003192014.o2JKEgJk067872@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to pjd@repoman.freebsd.org using -f From: Pawel Jakub Dawidek Date: Fri, 19 Mar 2010 20:14:27 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_geom.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2010 20:14:42 -0000 pjd 2010-03-19 20:14:27 UTC FreeBSD src repository Modified files: sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_geom.c Log: SVN rev 205346 on 2010-03-19 20:14:27Z by pjd The same code is used to import and to create pool. The order of operations is the following: 1. Try to open vdev by remembered path and guid. 2. If 1 failed, try to find vdev which guid matches and ignore the path. 3. If 2 failed this means either that the vdev we're looking for is gone or that pool is being created and vdev doesn't contain proper guid yet. To be able to handle pool creation we open vdev by path anyway. Because of 3 it is possible that we open wrong vdev on import which can lead to confusions. The solution for this is to check spa_load_state. On pool creation it will be equal to SPA_LOAD_NONE and we can open vdev only by path immediately and if it is not equal to SPA_LOAD_NONE we first open by path+guid and when that fails, we open by guid. We no longer open wrong vdev on import. MFC after: 2 weeks Revision Changes Path 1.18 +20 -10 src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c