shithub: gefs

Download patch

ref: f422794136d1b252998b0a31b6856de2717d7386
parent: f96595cc3fe1fba37aa890643211ed67133dc0c7
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Oct 3 22:54:42 EDT 2023

cachedel: when deallocing, we have to hold the lock.

--- a/blk.c
+++ b/blk.c
@@ -1014,12 +1014,12 @@
 
 	while(p != nil){
 		n = p->next;
-		cachedel(p->bp.addr);
-		if(p->b != nil)
-			dropblk(p->b);
 		a = getarena(p->bp.addr);
 		lock(a);
 		blkdealloc_lk(a, p->bp.addr);
+		cachedel(p->bp.addr);
+		if(p->b != nil)
+			dropblk(p->b);
 		unlock(a);
 		free(p);
 		p = n;