9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Nathaniel W Filardo <nwf@cs.jhu.edu>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] P9P venti/copy bug?
Date: Tue, 31 Mar 2009 03:15:40 -0400	[thread overview]
Message-ID: <20090331071540.GT22497@masters6.cs.jhu.edu> (raw)
In-Reply-To: <20090209165505.GA11908@unknown>

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

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 <me@acm.jhu.edu> wrote:
>>> 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 it.
>> 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...  
> I suspect that the block with the zero score is not actually in the 
> 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];
 
 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;


[-- Attachment #2: Type: application/pgp-signature, Size: 204 bytes --]

      reply	other threads:[~2009-03-31  7:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 12:56 Venkatesh Srinivas
2009-02-09 16:48 ` Russ Cox
2009-02-09 16:55   ` Venkatesh Srinivas
2009-03-31  7:15     ` Nathaniel W Filardo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090331071540.GT22497@masters6.cs.jhu.edu \
    --to=nwf@cs.jhu.edu \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).