shithub: riscv

Download patch

ref: 6d99af6f3455ebc1df29b13f8b1fe7f3338dc074
parent: 55e5418e6945ec3275d34e04047ad706f6eb8e68
author: glenda <glenda@9front.local>
date: Mon Aug 8 12:16:45 EDT 2022

walk: include qid version in deduplication

the qid version is part of the qid, take it into account
for deduplication.

--- a/sys/src/cmd/walk.c
+++ b/sys/src/cmd/walk.c
@@ -307,10 +307,11 @@
 	int i;
 	Cache *c;
 
-	c = &cache[dir->qid.path&(NCACHE-1)];
+	c = &cache[(dir->qid.path^dir->qid.vers)&(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;