From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 25 Aug 2009 20:04:48 -0400 Message-ID: <3aaafc130908251704r290afa5fsa3833c20db97bbbc@mail.gmail.com> From: "J.R. Mauro" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] Possible bug in p9p venti? Topicbox-Message-UUID: 52cd6880-ead5-11e9-9d60-3106f5b1d025 On Sun, Aug 23, 2009 at 11:10 AM, Venkatesh Srinivas 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 =3D 128K. > > A workaround is to clamp fsblocksize at MaxIo as well: > --- part.c.orig 2009-08-23 11:07:56.000000000 -0400 > +++ part.c =A02009-08-23 11:06:46.000000000 -0400 > @@ -166,6 +166,9 @@ > =A0 =A0 =A0 =A0 =A0 =A0part->fsblocksize =3D sfs.f_bsize; > =A0 =A0} > =A0#endif > + > + =A0 part->fsblocksize =3D min(part->fsblocksize, MaxIo); > + > =A0 =A0if(subname && findsubpart(part, subname) < 0){ > =A0 =A0 =A0 =A0werrstr("cannot find subpartition %s", subname); > =A0 =A0 =A0 =A0freepart(part); > > Thanks, > -- vs > > Any chance this is related to the issues we discussed on #plan9?