If we resize the blob we need to adjust the resolution of the
unused bitmap, and that is only possible for some bit patterns.
For now just ignore blobs with unused blocks.
Add an assert in add_tail() so that we don't forget that
add_tail is (probably) where we'd would do that adjustment.
Signed-off-by: Sage Weil <sage@redhat.com>
return false;
}
+ // FIXME: in some cases we could reduce unused resolution
+ if (get_blob().has_unused()) {
+ return false;
+ }
+
if (overflow > 0) {
new_blen -= overflow;
length -= overflow;
}
void add_tail(uint32_t new_len) {
assert(is_mutable());
+ assert(!has_unused());
assert(new_len > logical_length);
extents.emplace_back(
bluestore_pextent_t(
if (has_csum()) {
bufferptr t;
t.swap(csum_data);
- csum_data = buffer::create(get_csum_value_size() * logical_length / get_csum_chunk_size());
+ csum_data = buffer::create(
+ get_csum_value_size() * logical_length / get_csum_chunk_size());
csum_data.copy_in(0, t.length(), t.c_str());
- csum_data.zero( t.length(), csum_data.length() - t.length());
+ csum_data.zero(t.length(), csum_data.length() - t.length());
}
}
uint32_t get_release_size(uint32_t min_alloc_size) const {