Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description This is a bug fix for a bug I have recently found. I assume I have just gotten really lucky and that is why it took a while to find. # The problem When RingBuffer wraps around it is possible to write a smaller block than what was previously there. This means we have a buffer that looks like this: +------------+ | 2 | 1 |0000 | +------------+ Where 2 is smaller than previous block and when the next insert happens and we check to see if can overwrite the block we will end up seeing garbage and may or may not do it. # The fix We will allow for writes if we cannot determine if block header is valid. Other existing conditions will allow for protection against most corruptions, we just need to allow for write in the case of wrap around and writing a smaller block before hand. We do not want to skip beyond the fragmented block/data to try to avoid the problem as it will result in lots of fragmentation. Instead we want to do as described above and just allow the write and continue on. As we do not allow for write to pass read or read to pass write. # Todo (later prs) - [ ] Should merge into release 1.2
- Loading branch information