mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
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
This commit is contained in:
parent
ce4926cfc2
commit
b3d44a5141
3 changed files with 4 additions and 9 deletions
|
@ -118,12 +118,8 @@ readblk(Blk *b, Bptr bp, int flg)
|
|||
xh = bp.hash;
|
||||
ck = blkhash(b);
|
||||
}
|
||||
if((!flg&GBnochk) && ck != xh){
|
||||
if(!(flg&GBsoftchk))
|
||||
if((!flg&GBnochk) && ck != xh)
|
||||
broke("%s: %ullx %llux != %llux", Ecorrupt, bp.addr, xh, ck);
|
||||
fprint(2, "%s: %ullx %llux != %llux", Ecorrupt, bp.addr, xh, ck);
|
||||
error(Ecorrupt);
|
||||
}
|
||||
assert(b->magic == Magic);
|
||||
}
|
||||
|
||||
|
|
|
@ -269,7 +269,6 @@ enum {
|
|||
GBraw = 1<<0,
|
||||
GBwrite = 1<<1,
|
||||
GBnochk = 1<<2,
|
||||
GBsoftchk = 1<<3,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
@ -27,13 +27,13 @@ loadarena(Arena *a, Bptr hd)
|
|||
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());
|
||||
|
|
Loading…
Reference in a new issue