shithub: gefs

Download patch

ref: 7f9dc8e78ccd685387b0962fe61c671cd0a23f9e
parent: 25cc2858183091d1450288a17587b601510d61ba
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jan 8 12:47:11 EST 2024

fs: if the snap is clean, actually do nothing

compressing logs is still something that will need
an update and sync.

--- a/fs.c
+++ b/fs.c
@@ -65,10 +65,6 @@
 	if(fs->rdonly)
 		return;
 	qlock(&fs->synclk);
-	if(!fs->snap.dirty){
-		qunlock(&fs->synclk);
-		return;
-	}
 	if(waserror()){
 		fprint(2, "failed to sync: %s\n", errmsg());
 		qunlock(&fs->synclk);
@@ -2355,6 +2351,8 @@
 		switch(am->op){
 		case AOsync:
 			tracem("syncreq");
+			if(!fs->snap.dirty)
+				continue;
 			if(waserror()){
 				fprint(2, "sync error: %s\n", errmsg());
 				ainc(&fs->rdonly);
@@ -2445,6 +2443,7 @@
 			}
 			if(am->dent != nil)
 				qlock(&am->dent->trunclk);
+			fs->snap.dirty = 1;
 			for(off = am->off; off < am->length; off += Blksz){
 				qlock(&fs->mutlk);
 				if(waserror()){