The object may have trailing zeros.
Signed-off-by: Sage Weil <sage@redhat.com>
}
uint64_t size = layers.empty() ? 0 :
most_recent_gen()->get_length(most_recent());
- if (pos != size) {
- std::cout << "only read " << pos << " out of size " << size << std::endl;
- return false;
+ while (pos < size) {
+ if (*i != '\0') {
+ std::cout << "sparse read omitted non-zero data at " << pos << std::endl;
+ return false;
+ }
+ ++i;
+ ++pos;
}
+ assert(pos == size);
return true;
}