Merge "libsnapshot: add compatibility check" into main

This commit is contained in:
Daniel Zheng 2023-11-09 19:38:18 +00:00 committed by Gerrit Code Review
commit 0ac91e1f02

View file

@ -685,7 +685,8 @@ ssize_t CowReader::ReadData(const CowOperation* op, void* buffer, size_t buffer_
} else {
offset = GetCowOpSourceInfoData(*op);
}
if (!decompressor || op->data_length == header_.block_size) {
if (!decompressor ||
((op->data_length == header_.block_size) && (header_.prefix.major_version == 3))) {
CowDataStream stream(this, offset + ignore_bytes, op->data_length - ignore_bytes);
return stream.ReadFully(buffer, buffer_size);
}