From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 31 Mar 2009 03:15:40 -0400 From: Nathaniel W Filardo To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20090331071540.GT22497@masters6.cs.jhu.edu> References: <20090209125612.GA23938@unknown> <20090209165505.GA11908@unknown> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wty5iWagpjJlozQq" Content-Disposition: inline In-Reply-To: <20090209165505.GA11908@unknown> User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: [9fans] P9P venti/copy bug? Topicbox-Message-UUID: cdfbf090-ead4-11e9-9d60-3106f5b1d025 --Wty5iWagpjJlozQq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2009 at 11:55:05AM -0500, Venkatesh Srinivas wrote: > On Mon, Feb 09, 2009 at 08:48:33AM -0800, Russ Cox wrote: >> On Mon, Feb 9, 2009 at 4:56 AM, Venkatesh Srinivas wrot= e: >>> vcopy: reading block 0000000000000000000000000000000000000000 (type 16): >>> read asked for 0000000000000000000000000000000000000000 got >>> da39a3ee5e6b4b0d3255bfef95601890afd80709 >> >> The real question is how you got an archive with an all zeros score in i= t. >> There are some programs that use that internally to mean "no block" >> but any time such a block is written to venti, the score should be the >> zero-byte sha1 da39...0709. >> > > When I use -V with Plan 9's vcopy, the zero score block isn't listed... = =20 > I suspect that the block with the zero score is not actually in the=20 > archive? > > -- vs > I just tripped over this myself and found that apparently Plan 9 native vac sets root.prev to all zeros when there is no previous root. So I applied the diff below. I'm not sure this is a correct fix? --nwf; diff -r 74392a7c323c src/cmd/venti/copy.c --- a/src/cmd/venti/copy.c Wed Mar 11 13:37:29 2009 -0700 +++ b/src/cmd/venti/copy.c Tue Mar 31 03:12:53 2009 -0400 @@ -10,6 +10,8 @@ int fast; int verbose; VtConn *zsrc, *zdst; + +uchar allzeros[VtScoreSize]; =20 void usage(void) @@ -54,7 +56,8 @@ break; } walk(root.score, VtDirType, 0); - walk(root.prev, VtRootType, 0); + if(memcmp(root.prev, allzeros, VtScoreSize)) + walk(root.prev, VtRootType, 0); if(rewrite) vtrootpack(&root, buf); /* walk might have changed score */ break; --Wty5iWagpjJlozQq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknRwxwACgkQTeQabvr9Tc/QWwCfSQLUVPxP3GB8c8ac0Xe/uCnu aSgAn0aSHZ/ltwOMH6z1pfEha1Q2u4dI =dRcO -----END PGP SIGNATURE----- --Wty5iWagpjJlozQq--