From owner-freebsd-current@FreeBSD.ORG Sun May 20 12:00:31 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9352910656D1; Sun, 20 May 2012 12:00:31 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.13]) by mx1.freebsd.org (Postfix) with ESMTP id 2CE508FC08; Sun, 20 May 2012 12:00:18 +0000 (UTC) Received: from [78.35.187.152] (helo=fabiankeil.de) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1SW4ny-0007Lf-Vl; Sun, 20 May 2012 14:00:11 +0200 Date: Sun, 20 May 2012 13:59:16 +0200 From: Fabian Keil To: Pawel Jakub Dawidek Message-ID: <20120520135916.4e27fa39@fabiankeil.de> In-Reply-To: <20120520110815.GB1442@garage.freebsd.pl> References: <201205151707.q4FH7UDU096834@svn.freebsd.org> <20120520110815.GB1442@garage.freebsd.pl> Followup-To: freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/7U6OFtAH/bDq6.I2I1Qo0XS"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: svn-src-all@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon Subject: Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 12:00:31 -0000 --Sig_/7U6OFtAH/bDq6.I2I1Qo0XS Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Pawel Jakub Dawidek wrote: > On Tue, May 15, 2012 at 05:07:30PM +0000, Andriy Gapon wrote: > > Author: avg > > Date: Tue May 15 17:07:29 2012 > > New Revision: 235478 > > URL: http://svn.freebsd.org/changeset/base/235478 > >=20 > > Log: > > zpool_do_import: use /dev instead of /dev/dsk as a default > > =20 > > This affects behavior of zpool import without -d option. >=20 > How does it affect 'zpool import' behaviour? On FreeBSD when -d is not > given we should not scan entire /dev/, but take all available GEOM > providers from the GEOM. The problem was discussed in this thread: http://lists.freebsd.org/pipermail/freebsd-current/2012-May/033805.html (so I set Followup-To: freebsd-current@) Under some condition zpool import seems to do an lstat() on the searchdirs[0] default and bail out if it's unsuccessful. Here's a truss excerpt from such a failure: open("/dev/zfs",O_RDWR,030730440) =3D 3 (0x3) open("/dev/zero",O_RDONLY,0666) =3D 4 (0x4) open("/etc/zfs/exports",O_RDONLY,0666) =3D 5 (0x5) geteuid() =3D 0 (0x0) lstat("/dev",{ mode=3Ddr-xr-xr-x ,inode=3D2,size=3D512,blksize=3D4096 }) = =3D 0 (0x0) lstat("/dev/dsk",0x7fffffff83c0) ERR#2 'No such file or dir= ectory' cannot open '/dev/dsk': must be an absolute path write(2,"cannot open '/dev/dsk': must be "...,49) =3D 49 (0x31) close(3) =3D 0 (0x0) Currently (different kernel and world) I get: open("/dev/zfs",O_RDWR,030730440) =3D 3 (0x3) open("/dev/zero",O_RDONLY,0666) =3D 4 (0x4) open("/etc/zfs/exports",O_RDONLY,0666) =3D 5 (0x5) __sysctl(0x7fffffff7d60,0x2,0x7fffffff7da0,0x7fffffff7e08,0x801495259,0x13)= =3D 0 (0x0) __sysctl(0x7fffffff7da0,0x4,0x8016a3f80,0x7fffffff7e50,0x0,0x0) =3D 0 (0x0) ioctl(3,0xd5985a04 { IORW 0x5a('Z'), 4, 5528 },0xffff7e70) =3D 0 (0x0) ioctl(3,0xd5985a05 { IORW 0x5a('Z'), 5, 5528 },0xffff7e30) =3D 0 (0x0) ioctl(3,0xd5985a05 { IORW 0x5a('Z'), 5, 5528 },0xffff7e30) =3D 0 (0x0) lstat("/dev",{ mode=3Ddr-xr-xr-x ,inode=3D2,size=3D512,blksize=3D4096 }) = =3D 0 (0x0) open("/dev/",O_RDONLY,037777710000) =3D 6 (0x6) which seems to imply that zpool didn't use the searchdirs[0] default at all, so a version before r235478 probably would have worked as well. Fabian --Sig_/7U6OFtAH/bDq6.I2I1Qo0XS Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+43JgACgkQBYqIVf93VJ2/tgCgnm7bPi1vSiwsKcHoxjqbEZ3M 9gcAmgIdawoYOdbkGISWGJRYF4mXcVRA =8Vqz -----END PGP SIGNATURE----- --Sig_/7U6OFtAH/bDq6.I2I1Qo0XS--