9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Possible bug in p9p venti?
@ 2009-08-23 15:10 Venkatesh Srinivas
  2009-08-23 16:23 ` Russ Cox
  2009-08-26  0:04 ` J.R. Mauro
  0 siblings, 2 replies; 6+ messages in thread
From: Venkatesh Srinivas @ 2009-08-23 15:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi,

I think I've found a bug in p9p's Venti, if anyone were to take a look
at this code or tell me if I'm on the right track, it'd be pretty
neat.

When trying to start Venti on a FreeBSD 8-BETA2 system and a ZFS
filesystem, we got this error:
2009/0822 23:12:30 venti: conf...
2009/0822 23:12:30 err 4: read arena0 offset 0x60000 count 65536 buf
803f20000 returned 65536: No such file or directory
2009/0822 23:12:30 err 4: can't read arena0: read arena0 offset
0x60000 count 65536 buf 803f20000 returned 65536: No such file or
directory
venti: can't init server: can't initialize venti: arena0: can't read
arena0: read arena0 offset 0x60000 count 65536 buf 803f20000 returned
65536: No such

In venti/srv/part.c:325, opsize is clamped at MaxIo, which is 64KB by
default. Later, on :329, we issue a pread for opsize bytes from our
partition, but check that the read returned some multiple of
blocksize. (Blocksize comes from part->fsblocksize, which is gotten by
fstatfs()'s .f_bsize on unix.) This is a problem when MaxIo <
blocksize ; on ZFS on FreeBSD, f_bsize = 128K.

A workaround is to clamp fsblocksize at MaxIo as well:
--- part.c.orig 2009-08-23 11:07:56.000000000 -0400
+++ part.c  2009-08-23 11:06:46.000000000 -0400
@@ -166,6 +166,9 @@
            part->fsblocksize = sfs.f_bsize;
    }
 #endif
+
+   part->fsblocksize = min(part->fsblocksize, MaxIo);
+
    if(subname && findsubpart(part, subname) < 0){
        werrstr("cannot find subpartition %s", subname);
        freepart(part);

Thanks,
-- vs



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Possible bug in p9p venti?
  2009-08-23 15:10 [9fans] Possible bug in p9p venti? Venkatesh Srinivas
@ 2009-08-23 16:23 ` Russ Cox
  2009-08-26  0:04 ` J.R. Mauro
  1 sibling, 0 replies; 6+ messages in thread
From: Russ Cox @ 2009-08-23 16:23 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> A workaround is to clamp fsblocksize at MaxIo as well:
> +
> +   part->fsblocksize = min(part->fsblocksize, MaxIo);
> +

Sounds good to me.  Submit a patch.

Russ


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Possible bug in p9p venti?
  2009-08-23 15:10 [9fans] Possible bug in p9p venti? Venkatesh Srinivas
  2009-08-23 16:23 ` Russ Cox
@ 2009-08-26  0:04 ` J.R. Mauro
  2009-08-26  0:08   ` erik quanstrom
  1 sibling, 1 reply; 6+ messages in thread
From: J.R. Mauro @ 2009-08-26  0:04 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Sun, Aug 23, 2009 at 11:10 AM, Venkatesh Srinivas<me@acm.jhu.edu> wrote:
> Hi,
>
> I think I've found a bug in p9p's Venti, if anyone were to take a look
> at this code or tell me if I'm on the right track, it'd be pretty
> neat.
>
> When trying to start Venti on a FreeBSD 8-BETA2 system and a ZFS
> filesystem, we got this error:
> 2009/0822 23:12:30 venti: conf...
> 2009/0822 23:12:30 err 4: read arena0 offset 0x60000 count 65536 buf
> 803f20000 returned 65536: No such file or directory
> 2009/0822 23:12:30 err 4: can't read arena0: read arena0 offset
> 0x60000 count 65536 buf 803f20000 returned 65536: No such file or
> directory
> venti: can't init server: can't initialize venti: arena0: can't read
> arena0: read arena0 offset 0x60000 count 65536 buf 803f20000 returned
> 65536: No such
>
> In venti/srv/part.c:325, opsize is clamped at MaxIo, which is 64KB by
> default. Later, on :329, we issue a pread for opsize bytes from our
> partition, but check that the read returned some multiple of
> blocksize. (Blocksize comes from part->fsblocksize, which is gotten by
> fstatfs()'s .f_bsize on unix.) This is a problem when MaxIo <
> blocksize ; on ZFS on FreeBSD, f_bsize = 128K.
>
> A workaround is to clamp fsblocksize at MaxIo as well:
> --- part.c.orig 2009-08-23 11:07:56.000000000 -0400
> +++ part.c  2009-08-23 11:06:46.000000000 -0400
> @@ -166,6 +166,9 @@
>            part->fsblocksize = sfs.f_bsize;
>    }
>  #endif
> +
> +   part->fsblocksize = min(part->fsblocksize, MaxIo);
> +
>    if(subname && findsubpart(part, subname) < 0){
>        werrstr("cannot find subpartition %s", subname);
>        freepart(part);
>
> Thanks,
> -- vs
>
>

Any chance this is related to the issues we discussed on #plan9?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Possible bug in p9p venti?
  2009-08-26  0:04 ` J.R. Mauro
@ 2009-08-26  0:08   ` erik quanstrom
  2009-08-26  2:10     ` Venkatesh Srinivas
  2009-08-26 16:14     ` J.R. Mauro
  0 siblings, 2 replies; 6+ messages in thread
From: erik quanstrom @ 2009-08-26  0:08 UTC (permalink / raw)
  To: 9fans

>
> Any chance this is related to the issues we discussed on #plan9?
>

since not everyone who reads the list does irc, why
don't you fill us in on the issues discussed on #plan9?

- erik



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Possible bug in p9p venti?
  2009-08-26  0:08   ` erik quanstrom
@ 2009-08-26  2:10     ` Venkatesh Srinivas
  2009-08-26 16:14     ` J.R. Mauro
  1 sibling, 0 replies; 6+ messages in thread
From: Venkatesh Srinivas @ 2009-08-26  2:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Aug 25, 2009 at 8:08 PM, erik quanstrom<quanstro@quanstro.net> wrote:
>>
>> Any chance this is related to the issues we discussed on #plan9?
>>

No, I'm pretty sure not. This dealt with a relatively rare case, a
filesystem with an optimal read size larger than a constant in the
Venti source. The constant was 64K, which covered every FS/OS cross I
know of except ZFS on FreeBSD.

>
> since not everyone who reads the list does irc, why
> don't you fill us in on the issues discussed on #plan9?
>

The problem discussed in IRC relates to p9p vac's -a option, which
chains together vac trees to construct something like a dump
filesystem on unix.

The first problem was that a vac -a hadn't be run in a while, and the
newly added tree has some problem with it (either stored incorrectly
or being interpreted incorrectly...), which led to it being impossible
to traverse or base further vacs on.

The person in irc also had a problem where they blew away their Venti
index, rebuilt the index, and had checkindex still report errors. That
problem is pretty exciting too...

-- vs



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] Possible bug in p9p venti?
  2009-08-26  0:08   ` erik quanstrom
  2009-08-26  2:10     ` Venkatesh Srinivas
@ 2009-08-26 16:14     ` J.R. Mauro
  1 sibling, 0 replies; 6+ messages in thread
From: J.R. Mauro @ 2009-08-26 16:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Aug 25, 2009 at 8:08 PM, erik quanstrom<quanstro@quanstro.net> wrote:
>>
>> Any chance this is related to the issues we discussed on #plan9?
>>
>
> since not everyone who reads the list does irc, why
> don't you fill us in on the issues discussed on #plan9?
>
> - erik
>
>

Sorry, forgot to crossreference my thread on plan9port-dev:

http://groups.google.com/group/plan9port-dev/browse_thread/thread/54dde001eab50ad9#



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-26 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-23 15:10 [9fans] Possible bug in p9p venti? Venkatesh Srinivas
2009-08-23 16:23 ` Russ Cox
2009-08-26  0:04 ` J.R. Mauro
2009-08-26  0:08   ` erik quanstrom
2009-08-26  2:10     ` Venkatesh Srinivas
2009-08-26 16:14     ` J.R. Mauro

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).