shithub: gefs

Download patch

ref: dac3134b24202056232480f0e02cc3583ff8778e
parent: 7fa15946915dfffc3856c9075b20f591d1b00195
author: Ori Bernstein <ori@eigenstate.org>
date: Sun May 7 21:50:43 EDT 2023

fs: correctly track parent directory mode

--- a/fs.c
+++ b/fs.c
@@ -1095,6 +1095,9 @@
 				if(o->pqpath == Qdump){
 					mnt = fs->snapmnt;
 					filldumpdir(&d);
+					duid = d.uid;
+					dgid = d.gid;
+					dmode = d.mode;
 					goto Found;
 				}else if((e = findparent(o, &prev, &name, kbuf, sizeof(kbuf))) != nil){
 					rerror(m, e);
@@ -1108,6 +1111,9 @@
 				return;
 			}
 		}
+		duid = d.uid;
+		dgid = d.gid;
+		dmode = d.mode;
 		k.k = kbuf;
 		k.nk = p - kbuf;
 		if((e = lookup(mnt, &k, &kv, kvbuf, sizeof(kvbuf))) != nil)
@@ -1118,9 +1124,6 @@
 			return;
 		}
 Found:
-		duid = d.uid;
-		dgid = d.gid;
-		dmode = d.mode;
 		up = prev;
 		prev = d.qid.path;
 		r.wqid[i] = d.qid;