shithub: gefs

Download patch

ref: 3147291a2c825c506f56f3bd77656a7d84cc1677
parent: 64e0f1ce721df11448b56c4a38e20bb94cd27ae9
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Nov 5 23:26:27 EST 2023

fs: unlock dent on error

--- a/fs.c
+++ b/fs.c
@@ -1392,6 +1392,7 @@
 	}
 	assert(nm <= nelem(mb));
 	if((e = upsert(f->mnt, mb, nm)) != nil){
+		wunlock(de);
 		rerror(m, e);
 		goto Out;
 	}
@@ -2027,6 +2028,7 @@
 	kv[i].nv = p - sbuf;
 	if((e = upsert(f->mnt, kv, i+1)) != nil){
 		rerror(m, e);
+		wunlock(f->dent);
 		putfid(f);
 		abort();
 		return;
@@ -2310,8 +2312,8 @@
 {
 	Amsg *a;
 
-	while(1){
-		sleep(30*1000);
+	while(0){
+		sleep(5000);
 		a = mallocz(sizeof(Amsg), 1);
 		if(a == nil){
 			fprint(2, "alloc sync msg: %r\n");