Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 May 2015 18:26:56 +0200
From:      <rank1seeker@gmail.com>
To:        Trond =?UTF-8?Q?Endrest=C3=B8l?= <Trond.Endrestol@fagskolen.gjovik.no>
Cc:        hackers@freebsd.org
Subject:   Re: dumpfs incorrectly displays ufsid
Message-ID:  <20150526182656.000000bd@gmail.com>
In-Reply-To: <alpine.BSF.2.20.1505261307580.12925@mail.fig.ol.no>
References:  <20150526123126.00003bab@gmail.com> <alpine.BSF.2.20.1505261307580.12925@mail.fig.ol.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 26 May 2015 13:09:53 +0200 (CEST)
Trond Endrest=C3=B8l <Trond.Endrestol@fagskolen.gjovik.no> 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




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