ref: 4c0a0b139edd68bc32e352dc886e2b5c1831dfa5
parent: 0270f43fb3726cf8a351b4420b57fb83eedb28c2
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 5 21:45:53 EST 2025
gefs: use broke() when we get a corrupt block now that broke() doesn't abort the whole fs, but instead makes it go read-only, it makes sense to just use it in all cases that get a corrupt block
--- a/sys/src/cmd/gefs/blk.c
+++ b/sys/src/cmd/gefs/blk.c
@@ -118,12 +118,8 @@
xh = bp.hash;
ck = blkhash(b);
}
- if((!flg&GBnochk) && ck != xh){
- if(!(flg&GBsoftchk))
- broke("%s: %ullx %llux != %llux", Ecorrupt, bp.addr, xh, ck);
- fprint(2, "%s: %ullx %llux != %llux", Ecorrupt, bp.addr, xh, ck);
- error(Ecorrupt);
- }
+ if((!flg&GBnochk) && ck != xh)
+ broke("%s: %ullx %llux != %llux", Ecorrupt, bp.addr, xh, ck);
assert(b->magic == Magic);
}
--- a/sys/src/cmd/gefs/dat.h
+++ b/sys/src/cmd/gefs/dat.h
@@ -269,7 +269,6 @@
GBraw = 1<<0,
GBwrite = 1<<1,
GBnochk = 1<<2,
- GBsoftchk = 1<<3,
};
enum {
--- a/sys/src/cmd/gefs/load.c
+++ b/sys/src/cmd/gefs/load.c
@@ -27,13 +27,13 @@
h0 = nil;
h1 = nil;
if(!waserror()){
- h0 = getblk(bp, GBsoftchk);
+ h0 = getblk(bp, 0);
poperror();
}else
print("loading arena primary header: %s\n", errmsg());
bp.addr += Blksz;
if(!waserror()){
- h1 = getblk(bp, GBsoftchk);
+ h1 = getblk(bp, 0);
poperror();
}else
print("loading arena backup header: %s\n", errmsg());
--
⑨