I made this change to compile on 4th edition, with Geoff's 9k.
I don't know what is procsetname and how it is different from
threadsetname. Some format mismatches (%d for ulong and uintptr are
fixed), and there are still many warnings. 4th edition's cc doesn't
allow functions without return at the end.
vac and unvac works, and I tried to set up a fossil and snap -a, but
it constantly says archWalk: ... unimplemented. Perhaps make
neoventi fork to background when it is ready to use with fossil?
------------------------------------------
9fans: 9fans
Permalink:
https://9fans.topicbox.com/groups/9fans/Te748e03814ed814b-M76bb39d91f848a59782bb890
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
--- Begin Message ---
My reimplementation of venti[1], presented previously at IWP9, has
gone from "this will DEFINITELY eat your data in the first five
seconds" to "this will probably eat your data in the first five
minutes."
Any brave souls interested in testing it are invited to do so. I'll
definitely look at any stack traces or bugs or corruption you find,
but I can't promise to be able to recover data. It'll _probably_ be
recoverable. Probably.
Use at your own risk, yadda yadda, I'm only starting testing it with
fossil presently, but all the obvious tests I could think of offhand
are passing.
That means that all the remaining bugs are _subtle_, which is _more_
dangerous.
- Noam Preil
[1] https://git.sr.ht/~pixelherodev/neoventi
------------------------------------------
9fans: 9fans
Permalink:
https://9fans.topicbox.com/groups/9fans/T4d8ba4236feb5d92-Mdc787dc2648256807ea74cbe
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
--- End Message ---
diff -ru /n/pi4/usr/glenda/neoventi/arena.c /usr/glenda/neoventi/arena.c
--- /n/pi4/usr/glenda/neoventi/arena.c Tue Dec 9 13:45:28 2025
+++ /usr/glenda/neoventi/arena.c Tue Dec 9 18:22:55 2025
@@ -36,7 +36,7 @@
int good;
n = arena->arenastats.clumps;
corruptchain = 0;
- fprint(2, "clumps: %d, %d\n", n, arena->indexstats.clumps);
+ fprint(2, "clumps: %ld, %d\n", n, arena->indexstats.clumps);
if(n == arena->indexstats.clumps)
return 1;
buf = nil;
@@ -61,7 +61,7 @@
good = arenarepair(arena, (u8int*)ci, addr);
addr += (((u64int)(U16GET(ci + 1))) + 38);
if(!good){
- fprint(2, "clump %d is broken, at address %llud: %r\n",
m, addr);
+ fprint(2, "clump %ld is broken, at address %lld: %r\n",
m, addr);
corruptchain += 1;
// Skip. old venti creates corruption in some
easy-to-repro cases
// (e.g. write, kill venti within a few seconds) and I
don't need people
@@ -73,14 +73,14 @@
}
if(addr != goodaddr){
assert(corruptchain > 0);
- fprint(2, "corruption detected: the last %d clumps are corrupt.
Dropping them.\n"
+ fprint(2, "corruption detected: the last %ld clumps are
corrupt. Dropping them.\n"
"\taddr dropped from %llud to %llud\n",
corruptchain, addr, goodaddr);
addr = goodaddr;
arena->arenastats.clumps -= corruptchain;
}
if(arena->arenastats.used != addr){
- fprint(2, "corrupt: found addr %d, expected %d", addr,
arena->arenastats.used);
+ fprint(2, "corrupt: found addr %lld, expected %lld", addr,
arena->arenastats.used);
arena->arenastats.used = addr;
}
// TODO: we haven't updated indexstats->clumps, so this is safe, but we
_do_
diff -ru /n/pi4/usr/glenda/neoventi/cache.c /usr/glenda/neoventi/cache.c
--- /n/pi4/usr/glenda/neoventi/cache.c Tue Dec 9 13:45:28 2025
+++ /usr/glenda/neoventi/cache.c Tue Dec 9 18:13:59 2025
@@ -62,13 +62,13 @@
if(data == (void*)-1)
sysfatal("failed to allocate cache space of %llux",
(usize)ENTRYSIZE*ENTRIES);
buckets = sbrk(64 + 64*BUCKETS);
- displacement = ((usize)buckets & 0b111111);
+ displacement = ((usize)buckets & (~(~0 << 6)) ); //0b111111 );
if(displacement != 0){
displacement = 64 - displacement;
buckets = (bucket_t*)((usize)buckets + displacement);
}
// alignment
- assert(((usize)buckets&0b111111) == 0);
+ assert(((usize)buckets& (~(~0 << 6)) ) == 0);
for(int i = 0; i < BUCKETS; i += 1)
memset(buckets[i].index, 0xFF, 32);
bucketend = buckets + BUCKETS;
@@ -211,4 +211,5 @@
fprint(2, "impossible\n");
// DO NOT PROCEED if the cache might be corrupt!
abort();
+ return -1; /* shut up the compiler */
}
diff -ru /n/pi4/usr/glenda/neoventi/disk.c /usr/glenda/neoventi/disk.c
--- /n/pi4/usr/glenda/neoventi/disk.c Tue Dec 9 13:45:28 2025
+++ /usr/glenda/neoventi/disk.c Tue Dec 9 18:13:20 2025
@@ -63,6 +63,7 @@
}
werrstr("internal corruption: arena not found for arenaindex");
abort();
+ return -1; /* shut up the compiler */
}
int
@@ -154,7 +155,7 @@
aindex = aindexfromaddr(addr->offset);
addr->s_arena = &arenas[aindex];
addr->offset -= (addr->s_arena->base - addr->s_arena->blocksize);
- fprint(2, "entry found in bucket: arena %d, offset %d\n", aindex,
addr->offset);
+ fprint(2, "entry found in bucket: arena %lld, offset %lld\n", aindex,
addr->offset);
return 1;
}
@@ -243,7 +244,7 @@
{
index.arena->arenastats.sealed = 1;
if(index.arena->index+1 == numarenas)
- sysfatal("TODO last arena, %d, full, at size %d!",
index.arena->index, index.arena->arenastats.used);
+ sysfatal("TODO last arena, %d, full, at size %lld!",
index.arena->index, index.arena->arenastats.used);
index.arena = &arenas[index.arena->index+1];
if(index.arena->block != 0 || index.arena->offset != 0 ||
index.arena->blockremain != index.arena->blocksize || index.arena->buf != nil)
sysfatal("TODO handle writing to venti which previously
experienced nonlinear writes from other software?");
diff -ru /n/pi4/usr/glenda/neoventi/neoventi.c /usr/glenda/neoventi/neoventi.c
--- /n/pi4/usr/glenda/neoventi/neoventi.c Tue Dec 9 13:45:28 2025
+++ /usr/glenda/neoventi/neoventi.c Tue Dec 9 18:28:07 2025
@@ -5,7 +5,7 @@
#include "neoventi.h"
int mainstacksize = 128*1024;
-char *configpath = "/dev/kaladin/arenas";
+char *configpath = "/dev/sdC1/arenas";
char *arenapath;
char *isectpath;
diff -ru /n/pi4/usr/glenda/neoventi/server.c /usr/glenda/neoventi/server.c
--- /n/pi4/usr/glenda/neoventi/server.c Tue Dec 9 13:45:28 2025
+++ /usr/glenda/neoventi/server.c Tue Dec 9 13:47:49 2025
@@ -216,7 +216,7 @@
fd = announce(addr, adir);
if(fd < 0)
sysfatal("%r");
- procsetname("neoventi/server");
+ threadsetname("neoventi/server");
for(ctl = listen(adir, dir); ctl >= 0; ctl = listen(adir, dir)){
handle(ctl, dir);
close(ctl);