Date: Sat, 4 Aug 2007 23:07:22 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> Cc: freebsd-current@freebsd.org Subject: Re: zdb -l fix Message-ID: <20070804210722.GX37984@garage.freebsd.pl> In-Reply-To: <626eb4530708030737j17f67719r2bb1778c3ffe395@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Fri, Aug 03, 2007 at 11:37:30PM +0900, Hidetoshi Shimokawa wrote:
> Hi,
>
> 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
> ===================================================================
> --- 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);
> }
>
> - psize = statbuf.st_size;
> + if (S_ISCHR(statbuf.st_mode))
> + ioctl(fd, DIOCGMEDIASIZE, &psize);
> + else
> + psize = statbuf.st_size;
> +
> psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
>
> for (l = 0; l < VDEV_LABELS; l++) {
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
iD8DBQFGtOqKForvXbEpPzQRAh3gAKCTMon2NSQhR66bt+LGAibFLaEOiwCeMAPt
VX9b87wNoQVBIFJVpa/N6is=
=gJ2L
-----END PGP SIGNATURE-----
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070804210722.GX37984>
