Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2012 13:59:16 +0200
From:      Fabian Keil <freebsd-listen@fabiankeil.de>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        svn-src-all@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon <avg@FreeBSD.org>
Subject:   Re: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool
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>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/7U6OFtAH/bDq6.I2I1Qo0XS
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Pawel Jakub Dawidek <pjd@FreeBSD.org> 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--



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