]> git.lizzy.rs Git - plan9front.git/commitdiff
cfs: fix cfsctl interaction with mount cache (mount -C flag)
authorcinap_lenrek <cinap_lenrek@felloff.net>
Fri, 6 Jan 2017 01:54:26 +0000 (02:54 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Fri, 6 Jan 2017 01:54:26 +0000 (02:54 +0100)
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.

sys/src/cmd/cfs/cfs.c

index 82a508684a4da22b668b4ebd5134d009054bef72..c3a11b9b520916355e1689c769b81a105a7be4db 100644 (file)
@@ -438,10 +438,11 @@ ropen(Mfile *mf)
                        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 @@ rstat(Mfile *mf)
        Dir d;
 
        if(statson && ctltest(mf)){
-               genstats();
                d.qid = ctlqid;
                d.mode = 0444;
                d.length = statlen;     /* would be nice to do better */