From owner-freebsd-fs@FreeBSD.ORG Fri Mar 19 20:20:55 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD50A1065672 for ; Fri, 19 Mar 2010 20:20:55 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id EB6B58FC13 for ; Fri, 19 Mar 2010 20:20:54 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id CCB1445E35; Fri, 19 Mar 2010 21:20:52 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id A2EA645C9C; Fri, 19 Mar 2010 21:20:47 +0100 (CET) Date: Fri, 19 Mar 2010 21:20:47 +0100 From: Pawel Jakub Dawidek To: Alexander Leidinger Message-ID: <20100319202047.GA1733@garage.freebsd.pl> References: <4B8B5780.2050601@jrv.org> <20100302103826.14273mzlwp38550k@webmail.leidinger.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20100302103826.14273mzlwp38550k@webmail.leidinger.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-fs Subject: Re: [zfs] attach by name/uuid still attaches wrong device X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2010 20:20:55 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 02, 2010 at 10:38:26AM +0100, Alexander Leidinger wrote: > Quoting "James R. Van Artsdalen" (from =20 > Sun, 28 Feb 2010 23:58:24 -0600): >=20 > >I don't think it's possible to do this right in vdev_geom.c: there's no > >way to guess what is intended without a hint from higher ZFS layers as > >to which drives should be found and which are new. >=20 > There is a way: do not attach blindly. The same code was used for 'zpool import' and 'zpool create', so ignoring guids was needed to make creation work. Fortunately I found solution today by looking at different part of ZFS. I can distinguish creation from import by looking at vd->vdev_spa->spa_load_state. When it is equal to SPA_LOAD_NONE we're creating a pool and it is not, we're importing. This should be fixed now, see @205346. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkuj3J8ACgkQForvXbEpPzQSHQCg3XJGn31yFsURDGGFG7Rq7N9y WHUAmgNO/O9zI3EyR5Uxb6ODOdg2jkGE =RiCK -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL--