From owner-freebsd-current@FreeBSD.ORG Sat Aug 4 21:08:38 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1510316A41A for ; Sat, 4 Aug 2007 21:08:38 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF1D13C45A for ; Sat, 4 Aug 2007 21:08:37 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 0E9DE487F0; Sat, 4 Aug 2007 23:08:36 +0200 (CEST) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 1E0B145684; Sat, 4 Aug 2007 23:08:29 +0200 (CEST) Date: Sat, 4 Aug 2007 23:07:22 +0200 From: Pawel Jakub Dawidek To: Hidetoshi Shimokawa Message-ID: <20070804210722.GX37984@garage.freebsd.pl> References: <626eb4530708030737j17f67719r2bb1778c3ffe395@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Vx/u1Rx7tHHd/cso" Content-Disposition: inline In-Reply-To: <626eb4530708030737j17f67719r2bb1778c3ffe395@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.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=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-current@freebsd.org Subject: Re: zdb -l fix 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: Sat, 04 Aug 2007 21:08:38 -0000 --Vx/u1Rx7tHHd/cso Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 03, 2007 at 11:37:30PM +0900, Hidetoshi Shimokawa wrote: > Hi, >=20 > Current "zdb -l dev" causes errors on label 2 and 3. > The following patch fixes the problem. > It may be better to be incorporated into 7.0. > Thanks, Looks good, can you ask re@ for approval? > Index: src/contrib/opensolaris/cmd/zdb/zdb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- src.orig/contrib/opensolaris/cmd/zdb/zdb.c 2007-08-02 > 01:25:16.000000000 +0900 > +++ src/contrib/opensolaris/cmd/zdb/zdb.c 2007-08-03 > 23:28:06.475733977 +0900 > @@ -1136,7 +1136,11 @@ > exit(1); > } >=20 > - psize =3D statbuf.st_size; > + if (S_ISCHR(statbuf.st_mode)) > + ioctl(fd, DIOCGMEDIASIZE, &psize); > + else > + psize =3D statbuf.st_size; > + > psize =3D P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t)); >=20 > for (l =3D 0; l < VDEV_LABELS; l++) { --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Vx/u1Rx7tHHd/cso Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGtOqKForvXbEpPzQRAh3gAKCTMon2NSQhR66bt+LGAibFLaEOiwCeMAPt VX9b87wNoQVBIFJVpa/N6is= =gJ2L -----END PGP SIGNATURE----- --Vx/u1Rx7tHHd/cso--