ref: a840b597cad282e837560b65dad89aa0cfd4af77
parent: 518a40ae95535f2b6fc59397155267d54c858343
author: cinap_lenrek <[email protected]>
date: Sat Jul 23 22:17:45 EDT 2016
upas/fs: remove checkmboxrefs() debugging code, properly handle errors in 9p loop
--- a/sys/src/cmd/upas/fs/dat.h
+++ b/sys/src/cmd/upas/fs/dat.h
@@ -145,7 +145,6 @@
String* date822tounix(char*);
int fidmboxrefs(Mailbox*);
int hashmboxrefs(Mailbox*);
-void checkmboxrefs(void);
extern int debug;
extern int fflag;
--- a/sys/src/cmd/upas/fs/fs.c
+++ b/sys/src/cmd/upas/fs/fs.c
@@ -1165,23 +1165,11 @@
}
}
- for(;;){
- /*
- * reading from a pipe or a network device
- * will give an error after a few eof reads
- * however, we cannot tell the difference
- * between a zero-length read and an interrupt
- * on the processes writing to us,
- * so we wait for the error
- */
- checkmboxrefs();
- n = read9pmsg(mfd[0], mdata, messagesize);
- if(n == 0)
- continue;
+ while((n = read9pmsg(mfd[0], mdata, messagesize)) != 0){
if(n < 0)
- return;
- if(convM2S(mdata, n, &thdr) == 0)
- continue;
+ error("mount read");
+ if(convM2S(mdata, n, &thdr) != n)
+ error("convM2S format error");
if(debug)
fprint(2, "%s:<-%F\n", argv0, &thdr);
@@ -1614,25 +1602,6 @@
}
qunlock(&hashlock);
return refs;
-}
-
-void
-checkmboxrefs(void)
-{
- int f, refs;
- Mailbox *mb;
-
- qlock(&mbllock);
- for(mb=mbl; mb; mb=mb->next){
- qlock(mb);
- refs = (f=fidmboxrefs(mb))+1;
- if(refs != mb->refs){
- fprint(2, "mbox %s %s ref mismatch actual %d (%d+1) expected %d\n", mb->name, mb->path, refs, f, mb->refs);
- abort();
- }
- qunlock(mb);
- }
- qunlock(&mbllock);
}
void