cwfs: restore backup block even if directory block didnt got a new address

cinap_lenrek 2011-06-06 07:16:00 +00:00
parent 9310110448
commit c39aecc111
1 changed files with 14 additions and 14 deletions

View File

@ -1448,19 +1448,21 @@ cwrecur(Cw *cw, Off addr, int tag, int tag1, long qp)
cw->depth--; cw->depth--;
if(na){ if(b){
if(b){ p = getbuf(cw->dev, na ? na : addr, Brd);
p = getbuf(cw->dev, na, Brd); if(!p || checktag(p, tag, qp)){
if(!p || checktag(p, tag, qp)){ fprint(2, "cwrecur: b/p null\n");
fprint(2, "cwrecur: b/p null %s\n", cw->name); na = 0;
na = 0; } else {
} else { memmove(p->iobuf, b->iobuf, RBUFSIZE);
memmove(p->iobuf, b->iobuf, RBUFSIZE); p->flags |= Bmod|Bimm;
p->flags |= Bmod|Bimm;
}
if(p)
putbuf(p);
} }
if(p)
putbuf(p);
putbuf(b);
}
if(na){
if(shouldstop){ if(shouldstop){
if(cw->falsehits < 10) if(cw->falsehits < 10)
fprint(2, "shouldstop %lld %lld t=%s %s\n", fprint(2, "shouldstop %lld %lld t=%s %s\n",
@ -1469,8 +1471,6 @@ cwrecur(Cw *cw, Off addr, int tag, int tag1, long qp)
cw->falsehits++; cw->falsehits++;
} }
} }
if(b)
putbuf(b);
return na; return na;
} }