git: 9front

Download patch

ref: 477214d5055b173f48891b67331b180c9f142651
parent: e94aea489139c23ed1ef9c7332a0e718f816b268
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Feb 4 11:29:28 EST 2026

gefs: fix refcount leak when deleting snapshots in some cases

when deleting a snap, we would decrement the in-memory refcount,
but we wouldn't immediately sync it to disk; if we dropped it
and then read it back from disk, we would end up with an out of
sync refcount.

fix this by syncing eagerly.

--- a/sys/src/cmd/gefs/snap.c
+++ b/sys/src/cmd/gefs/snap.c
@@ -359,6 +359,10 @@
 		m[nm].v = nil;
 		m[nm].nv = 0;
 		nm++;
+	}else{
+		m[nm].op = Oinsert;
+		tree2kv(t, &m[nm], buf[nm], sizeof(buf[nm]));
+		nm++;
 	}
 	assert(nm <= nelem(m));
 	dlsync();
--