shithub: gefs

Download patch

ref: 3b8f163352bfcfec4e1445fd4a2fb55d6d8fec8e
parent: e718d0c3b4211317c228b0568462c359c99b73b2
author: Ori Bernstein <ori@eigenstate.org>
date: Sun May 28 14:00:50 EDT 2023

blk: init logtl correctly

--- a/blk.c
+++ b/blk.c
@@ -372,6 +372,8 @@
 		switch(op){
 		case LogEnd:
 			dprint("\tlog@%d: end\n", i);
+			if(a->logtl == nil)
+				a->logtl = holdblk(b);
 			dropblk(b);
 			return 0;
 		case LogChain:
@@ -1125,10 +1127,6 @@
 	for(i = 0; i < fs->narena; i++){
 		a = &fs->arenas[i];
 		lock(a);
-		if(a->logtl == nil){
-			unlock(a);
-			continue;
-		}
 		if(a->deferhd.addr != -1){
 			chainlog(a->logtl, a->deferhd.addr);
 			loadlog(a, a->deferhd);