ref: baeeb6625d82f23b29ea1b588facef185011b5df
parent: 69f6753439a740e4f5635ba6035236475d67db98
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Sep 23 14:31:46 EDT 2024
walk: qid.vers should be ignored (thanks BurnZeZ) No idea who committed this in 2022 as its "glenda@9front.local", but as qid.vers is incremented for each write and we definitely should not use it as the cache tag. Also, the initial code was stolen from du.c as the comment says, and that one does the right thing.
--- a/sys/src/cmd/walk.c
+++ b/sys/src/cmd/walk.c
@@ -307,11 +307,10 @@
int i;
Cache *c;
- c = &cache[(dir->qid.path^dir->qid.vers)&(NCACHE-1)];
+ c = &cache[dir->qid.path&(NCACHE-1)];
dp = c->cache;
for(i=0; i<c->n; i++, dp++)
if(dir->qid.path == dp->qid.path &&
- dir->qid.vers == dp->qid.vers &&
dir->type == dp->type &&
dir->dev == dp->dev)
return 1;
--
⑨