1. do not assume that Maxblock is >= the kernel's iounit. 2. set the name of the fsysproc. 3. use erealloc not realloc. Notes: Fri Jan 25 13:39:55 EST 2013 geoff this can't be right; you're using t.msize before it's initialised. i think i know what you intended, though. Reference: /n/sources/patch/applied/acme-iounit Date: Fri Jan 25 05:46:43 CET 2013 Signed-off-by: quanstro@quanstro.net Reviewed-by: geoff --- /sys/src/cmd/acme/fsys.c Fri Jan 25 05:43:10 2013 +++ /sys/src/cmd/acme/fsys.c Fri Jan 25 05:43:09 2013 @@ -145,6 +145,8 @@ Fcall t; uchar *buf; + threadsetname("fsysproc"); + x = nil; for(;;){ buf = emalloc(messagesize+UTFmax); /* overflow for appending partial rune in xfidwrite */ @@ -323,8 +325,9 @@ if(x->msize < 256) return respond(x, &t, "version: message size too small"); - messagesize = x->msize; - t.msize = messagesize; + if(t.msize > Maxblock) + t.msize = Maxblock; + messagesize = t.msize + IOHDRSZ; if(strncmp(x->version, "9P2000", 6) != 0) return respond(x, &t, "unrecognized 9P version"); t.version = "9P2000"; @@ -625,7 +628,7 @@ for(j=0; jnw; k++){ - ids = realloc(ids, (nids+1)*sizeof(int)); + ids = erealloc(ids, (nids+1)*sizeof(int)); ids[nids++] = c->w[k]->id; } }