git: 9front

Download patch

ref: 8e72067d5f39f98daadd6f5f2ed09e8cc558d22f
parent: c208612ab5859952b08b030c8650eb17296e793e
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Wed Nov 7 17:04:29 EST 2012

limit clunk queue length for cclose()

dont let the clunk queue grow too large if we are allowed to
block (cclose) as the fileserver might run out of fids.

--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -476,8 +476,8 @@
 struct {
 	Chan *head;
 	Chan *tail;
-	int nqueued;
-	int nclosed;
+	ulong nqueued;
+	ulong nclosed;
 	Lock l;
 	QLock q;
 	Rendez r;
@@ -555,7 +555,8 @@
 
 	if(devtab[c->type]->dc == L'M')
 	if((c->flag&(CRCLOSE|CCACHE)) == CCACHE)
-	if((c->qid.type&(QTEXCL|QTMOUNT|QTAUTH)) == 0){
+	if((c->qid.type&(QTEXCL|QTMOUNT|QTAUTH)) == 0)
+	if((clunkq.nqueued - clunkq.nclosed) < 64){
 		closechanq(c);
 		return;
 	}
--