git: 9front

Download patch

ref: 483933dbfb5f71ba32c14552ef78f0c1e25d8c1a
parent: 239f8a569314a1f20ce2d6c88fbaf8be4c4def2a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jan 5 21:54:26 EST 2017

cfs: fix cfsctl interaction with mount cache (mount -C flag)

the root fileserver is mounted with the mount cache enabled
causing the contents of the cfsctl file to be cached as well
leading to wrong results. so after we generated the new stat
buffer, we increment the qid.vers so the cache starts out
clean.

--- a/sys/src/cmd/cfs/cfs.c
+++ b/sys/src/cmd/cfs/cfs.c
@@ -438,10 +438,11 @@
 			sendreply("does not exist");
 			return;
 		}
+		genstats();
+		ctlqid.vers++;
 		c.rhdr.qid = ctlqid;
 		c.rhdr.iounit = 0;
 		sendreply(0);
-		genstats();
 		return;
 	}
 	if(delegate() == 0){
@@ -650,7 +651,6 @@
 	Dir d;
 
 	if(statson && ctltest(mf)){
-		genstats();
 		d.qid = ctlqid;
 		d.mode = 0444;
 		d.length = statlen;	/* would be nice to do better */
--