From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <45219fb00802041338teb1a548i29b212643bf5a5d@mail.gmail.com> Date: Mon, 4 Feb 2008 22:38:03 +0100 From: "=?UTF-8?Q?Llu=C3=ADs_Batlle?=" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Two ramfs? In-Reply-To: <20080204203454.555AC1E8C35@holo.morphisms.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45219fb00802040802i733d99advb98093acbe5f7ef@mail.gmail.com> <20080204203454.555AC1E8C35@holo.morphisms.net> Topicbox-Message-UUID: 45c12af2-ead3-11e9-9d60-3106f5b1d025 Thank you. I'll try to play with File and Tree now. btw, I had some problems on /tmp due to free space, getting messages from ./INSTALL as these: ... copy.o: No space left on device /tmp/cc2IGQH6.s: Assembler messages: /tmp/cc2IGQH6.s:3059: FATAL: Can't write copy.o: Invalid argument mk: 9c copy.c : exit status=exit(1) mk: for i in ... : exit status=exit(1) mk: for i in ... : exit status=exit(1) ... nevertheless, the INSTALL script returned errorlevel 0. I don't think this bothers many people, but I wasn't watching the command output, and I trusted the errorlevel. Regards. 2008/2/4, Russ Cox : > > I saw the src/cmd/ramfs.c, and I think I should be able to write mine > > simpler... For example, I'd like to take advantage of the File/Tree > > interface (createfile(), ...), having all the files of the fs in > > memory. > > > > I found also src/lib9p/ramfs.c, which looks pretty much as what I > > want, but this doesn't tollerate remounting well at all (I guess). > > > > I tried it with some modifications (to get it compiled) in plan9port > > over linux (./ramfs -D -s test) and two "9p ls test" in a row makes > > the server die. > > > > Where can I see an example of a working fileserver which uses File, > > Tree, and the related functions? > > It's been a long time since I looked at that code, but it appears > that the problem is that Tattach doesn't increment the reference > count on its directory. Reattaching isn't very common in Plan 9 > (but is on p9p) so it's easy to believe this bug went unnoticed. > > Here is the fix, now in p9p: > > diff -r bcad073690c5 src/lib9p/srv.c > --- a/src/lib9p/srv.c Fri Feb 01 07:54:19 2008 -0500 > +++ b/src/lib9p/srv.c Mon Feb 04 15:32:28 2008 -0500 > @@ -227,7 +227,7 @@ sattach(Srv *srv, Req *r) > r->fid->uid = estrdup9p(r->ifcall.uname); > if(srv->tree){ > r->fid->file = srv->tree->root; > - /* BUG? incref(r->fid->file) ??? */ > + incref(&r->fid->file->ref); > r->ofcall.qid = r->fid->file->dir.qid; > r->fid->qid = r->ofcall.qid; > } > > Russ > >