From owner-freebsd-current@FreeBSD.ORG Fri Aug 3 15:05:30 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 79B3916A41F for ; Fri, 3 Aug 2007 15:05:30 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1B613C46A for ; Fri, 3 Aug 2007 15:05:29 +0000 (UTC) (envelope-from freebsd@gm.nunu.org) Received: by py-out-1112.google.com with SMTP id a73so1582998pye for ; Fri, 03 Aug 2007 08:05:29 -0700 (PDT) Received: by 10.35.40.10 with SMTP id s10mr4851944pyj.1186151851048; Fri, 03 Aug 2007 07:37:31 -0700 (PDT) Received: by 10.35.79.1 with HTTP; Fri, 3 Aug 2007 07:37:30 -0700 (PDT) Message-ID: <626eb4530708030737j17f67719r2bb1778c3ffe395@mail.gmail.com> Date: Fri, 3 Aug 2007 23:37:30 +0900 From: "Hidetoshi Shimokawa" Sender: freebsd@gm.nunu.org To: "Pawel Jakub Dawidek" , freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 01f1f13bc221276e Cc: Subject: 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: Fri, 03 Aug 2007 15:05:30 -0000 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, 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++) { -- /\ Hidetoshi Shimokawa \/ simokawa@FreeBSD.ORG