From owner-freebsd-hackers@FreeBSD.ORG Tue May 26 16:27:08 2015 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 214B9764 for ; Tue, 26 May 2015 16:27:08 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABCF9A98 for ; Tue, 26 May 2015 16:27:07 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: by wifw1 with SMTP id w1so37457903wif.0 for ; Tue, 26 May 2015 09:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ZPmAfiFNdS64iamLiR6G+PhHpMKAcAWybuFs504qk/Y=; b=G0demdW7bsiL2pa4eCMrNShRXq4xE/VJt+O3g5sluw8Z21063+MVsK196aR6DmBawE wO/QbYWj6zHRlei1wGbnipi6DYTw7Ec08c6eMTro6DZbgWtrOgotSxOn170Oj3LQcKD6 hlPKKdJtlMBKy64h12usq+6JQwcgV3g+cJLW3xUM0KJuhdo6zZFm7BdyvVwCSBhLZ7jm jA/6llu8eHfzDeN9TY88hArZfRryvAQ/oqDEECi9rKyngdmQ4CToxHjE3jOJYdoR6wSU tlDDpI/8TgHyWXAEh8dRPtn4Re8z9hOl3Jd2sHpxo569DSK/rXIDrUIMWgSmB8rajolW j5og== X-Received: by 10.194.193.71 with SMTP id hm7mr44595195wjc.40.1432657626181; Tue, 26 May 2015 09:27:06 -0700 (PDT) Received: from localhost ([193.198.56.245]) by mx.google.com with ESMTPSA id xy5sm22521457wjc.35.2015.05.26.09.27.04 (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 May 2015 09:27:05 -0700 (PDT) Date: Tue, 26 May 2015 18:26:56 +0200 From: To: Trond =?UTF-8?Q?Endrest=C3=B8l?= Cc: hackers@freebsd.org Subject: Re: dumpfs incorrectly displays ufsid Message-ID: <20150526182656.000000bd@gmail.com> In-Reply-To: References: <20150526123126.00003bab@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2015 16:27:08 -0000 On Tue, 26 May 2015 13:09:53 +0200 (CEST) Trond Endrest=C3=B8l wrote: > On Tue, 26 May 2015 12:31+0200, rank1seeker@gmail.com wrote: >=20 > > I've reported this at REL 8.2, long ago at May 2011 > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D156908 > >=20 > > Now at 10.1-RELEASE-p10 #0 r282952 i386 > >=20 > > This happens, ONLY when first chars are 0 (zeros) in second pair of > > 8 chars, in which case dumpfs, ommits them. > > I.e; For: > > /dev/ufsid/3b9aca0000000001 > >=20 > > # dumpfs ada0s1h | head -2 > > magic 19540119 (UFS2) time Sun Sep 9 03:46:40 2001 > > superblock location 65536 id [ 3b9aca00 1 ] > >=20 > > Problem is in '[ 3b9aca00 1 ]' >=20 > If you apply this patch, then the case for UFS2 is treated similar to=20 > the case for UFS1: >=20 > Index: sbin/dumpfs/dumpfs.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 > --- sbin/dumpfs/dumpfs.c (revision 283516) > +++ sbin/dumpfs/dumpfs.c (working copy) > @@ -165,7 +165,7 @@ > fstime =3D afs.fs_time; > printf("magic\t%x (UFS2)\ttime\t%s", > afs.fs_magic, ctime(&fstime)); > - printf("superblock location\t%jd\tid\t[ %x %x ]\n", > + printf("superblock location\t%jd\tid\t[ %08x %08x > ]\n", (intmax_t)afs.fs_sblockloc, afs.fs_id[0], afs.fs_id[1]); > printf("ncg\t%d\tsize\t%jd\tblocks\t%jd\n", > afs.fs_ncg, (intmax_t)fssize, > (intmax_t)afs.fs_dsize); >=20 Applied patch ... rm -f dumpfs dumpfs.o dumpfs.8.gz dumpfs.8.cat.gz /usr/obj/usr/src/sbin/dumpfs created for /usr/src/sbin/dumpfs rm -f .depend mkdep -f .depend -a -std=3Dgnu99 /usr/src/sbin/dumpfs/dumpfs.c echo dumpfs: /usr/lib/libc.a /usr/lib/libufs.a >> .depend cc -O2 -pipe -march=3Dprescott -std=3Dgnu99 -Qunused-arguments -fstack-pr= otector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -= Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-var= iable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality= -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wn= o-knr-promoted-parameter -c /usr/src/sbin/dumpfs/dumpfs.c cc -O2 -pipe -march=3Dprescott -std=3Dgnu99 -Qunused-arguments -fstack-pr= otector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -= Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-var= iable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality= -Wno-unused-function -Wno-enum-conversion -Wno-switch -Wno-switch-enum -Wn= o-knr-promoted-parameter -o dumpfs dumpfs.o -lufs gzip -cn /usr/src/sbin/dumpfs/dumpfs.8 > dumpfs.8.gz install -s -o root -g wheel -m 555 dumpfs /sbin/dumpfs install -o root -g wheel -m 444 dumpfs.8.gz /usr/share/man/man8 rm -f dumpfs dumpfs.o dumpfs.8.gz dumpfs.8.cat.gz And ... # dumpfs ada0s1h | head -2 magic 19540119 (UFS2) time Sun Sep 9 03:46:40 2001 superblock location 65536 id [ 3b9aca00 00000001 ] Ok, it works! Could you now commit it ASAP? Thanks. Domagoj Smol=C4=8Di=C4=87