ref: 1cbc327cea62e6a0ba91f279b74e8fa446e3dec9
parent: ad74aa72f7247cc22232c3f520246607ca7516a4
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Oct 17 17:29:26 EDT 2023
ream: init generations so first blocks will not get clobbered when setting the prev generation to -1, we indicate that the block should be freed and reused, when in fact it's part of a snapshot that should be held on to. Set the generation to the current generation instead, so that we deadlist the block.
--- a/ream.c
+++ b/ream.c
@@ -133,7 +133,7 @@
t.nlbl = 2;
t.ht = 1;
t.gen = fs->nextgen++;
- t.prev = -1ULL;
+ t.prev = t.gen;
t.bp = r->bp;
p = packtree(vbuf, sizeof(vbuf), &t);
kv.v = vbuf;
@@ -149,7 +149,7 @@
t.nlbl = 1;
t.ht = 1;
t.gen = fs->nextgen++;
- t.prev = -1ULL;
+ t.prev = t.gen;
t.bp = a->bp;
p = packtree(vbuf, sizeof(vbuf), &t);
kv.v = vbuf;