Fix new_seqno()'s recovery from seqno mismatch
A sequence number mismatch occurs when an invalid copy (with a stale sequence number) gets written. To continue after the error, we need to use the current sequence number. But new_seqno() used the larger one of the two, which is correct only as long as sequence numbers do not overflow. Overflow is rather unlikely, though.
This commit is contained in:
parent
0ba61f1714
commit
18148f03fa
1 changed files with 1 additions and 2 deletions
|
@ -603,8 +603,7 @@ new_seqno(struct empfile *ep, void *buf)
|
|||
if (!(ep->flags & EFF_TYPED))
|
||||
return;
|
||||
old_seqno = get_seqno(ep, elt->uid);
|
||||
if (CANT_HAPPEN(old_seqno != elt->seqno))
|
||||
old_seqno = MAX(old_seqno, elt->seqno);
|
||||
CANT_HAPPEN(old_seqno != elt->seqno);
|
||||
elt->seqno = old_seqno + 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue