Closed shaitan closed 8 years ago
Does it mean that we have checksums for zero data already in the storage? How eblob will read those keys now?
Does it mean that we have checksums for zero data already in the storage?
No, it doesn't because zero data has no checksum.
How eblob will read those keys now?
It will read only header and fill result with zero data size.
So basically this is an optimization for checksum verification - do not try to verify it if data size is zero? What does it read right now?
Looks like it converts last_chunk
into very large number (-1 as 64bit unsigned long long), and if allocation succeeds, it reads data from another very large offset, which likely fails? Is that correct?
Basically, it is fix for both verification and calculation - do not try calculate checksum if data size is zero. What read do you mean?
Yes, if both offset and size is zero, it set last_chunk
to -1ULL
earlier which led to huge memory allocation and checksums calculation for incorrect data.
Ok, I see. Patch applied, thank you
In
eblob_chunked_mmhash
size
== 0 can be caused by only one of:in both cases checksums shouldn't be calculated because no data is touched or updated.